@@ -23,6 +23,7 @@ import java.io.Serializable;
|
||||
* @author Thomas Darimont
|
||||
* @author Oliver Gierke
|
||||
* @author Alex Bondarev
|
||||
* @author Johannes Englmeier
|
||||
*/
|
||||
public abstract class AbstractPageRequest implements Pageable, Serializable {
|
||||
|
||||
@@ -41,11 +42,11 @@ public abstract class AbstractPageRequest implements Pageable, Serializable {
|
||||
public AbstractPageRequest(int page, int size) {
|
||||
|
||||
if (page < 0) {
|
||||
throw new IllegalArgumentException("Page index must not be less than zero!");
|
||||
throw new IllegalArgumentException("Page index must not be less than zero");
|
||||
}
|
||||
|
||||
if (size < 1) {
|
||||
throw new IllegalArgumentException("Page size must not be less than one!");
|
||||
throw new IllegalArgumentException("Page size must not be less than one");
|
||||
}
|
||||
|
||||
this.page = page;
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Mark Paluch
|
||||
* @author Johannes Englmeier
|
||||
*/
|
||||
public class Sort implements Streamable<org.springframework.data.domain.Sort.Order>, Serializable {
|
||||
|
||||
@@ -64,7 +65,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
private Sort(Direction direction, List<String> properties) {
|
||||
|
||||
if (properties == null || properties.isEmpty()) {
|
||||
throw new IllegalArgumentException("You have to provide at least one property to sort by!");
|
||||
throw new IllegalArgumentException("You have to provide at least one property to sort by");
|
||||
}
|
||||
|
||||
this.orders = properties.stream() //
|
||||
@@ -304,7 +305,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
return Direction.valueOf(value.toUpperCase(Locale.US));
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(String.format(
|
||||
"Invalid value '%s' for orders given! Has to be either 'desc' or 'asc' (case insensitive).", value), e);
|
||||
"Invalid value '%s' for orders given! Has to be either 'desc' or 'asc' (case insensitive)", value), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,7 +437,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
private Order(@Nullable Direction direction, String property, boolean ignoreCase, NullHandling nullHandling) {
|
||||
|
||||
if (!StringUtils.hasText(property)) {
|
||||
throw new IllegalArgumentException("Property must not be null or empty!");
|
||||
throw new IllegalArgumentException("Property must not be null or empty");
|
||||
}
|
||||
|
||||
this.direction = direction == null ? DEFAULT_DIRECTION : direction;
|
||||
|
||||
Reference in New Issue
Block a user