@@ -46,7 +46,7 @@ public class AbstractAggregateRoot<A extends AbstractAggregateRoot<A>> {
|
||||
*/
|
||||
protected <T> T registerEvent(T event) {
|
||||
|
||||
Assert.notNull(event, "Domain event must not be null!");
|
||||
Assert.notNull(event, "Domain event must not be null");
|
||||
|
||||
this.domainEvents.add(event);
|
||||
return event;
|
||||
@@ -78,7 +78,7 @@ public class AbstractAggregateRoot<A extends AbstractAggregateRoot<A>> {
|
||||
@SuppressWarnings("unchecked")
|
||||
protected final A andEventsFrom(A aggregate) {
|
||||
|
||||
Assert.notNull(aggregate, "Aggregate must not be null!");
|
||||
Assert.notNull(aggregate, "Aggregate must not be null");
|
||||
|
||||
this.domainEvents.addAll(aggregate.domainEvents());
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ abstract class Chunk<T> implements Slice<T>, Serializable {
|
||||
*/
|
||||
public Chunk(List<T> content, Pageable pageable) {
|
||||
|
||||
Assert.notNull(content, "Content must not be null!");
|
||||
Assert.notNull(pageable, "Pageable must not be null!");
|
||||
Assert.notNull(content, "Content must not be null");
|
||||
Assert.notNull(pageable, "Pageable must not be null");
|
||||
|
||||
this.content.addAll(content);
|
||||
this.pageable = pageable;
|
||||
@@ -116,7 +116,7 @@ abstract class Chunk<T> implements Slice<T>, Serializable {
|
||||
*/
|
||||
protected <U> List<U> getConvertedContent(Function<? super T, ? extends U> converter) {
|
||||
|
||||
Assert.notNull(converter, "Function must not be null!");
|
||||
Assert.notNull(converter, "Function must not be null");
|
||||
|
||||
return this.stream().map(converter::apply).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -121,8 +121,8 @@ public interface ExampleMatcher {
|
||||
*/
|
||||
default ExampleMatcher withMatcher(String propertyPath, MatcherConfigurer<GenericPropertyMatcher> matcherConfigurer) {
|
||||
|
||||
Assert.hasText(propertyPath, "PropertyPath must not be empty!");
|
||||
Assert.notNull(matcherConfigurer, "MatcherConfigurer must not be empty!");
|
||||
Assert.hasText(propertyPath, "PropertyPath must not be empty");
|
||||
Assert.notNull(matcherConfigurer, "MatcherConfigurer must not be empty");
|
||||
|
||||
GenericPropertyMatcher genericPropertyMatcher = new GenericPropertyMatcher();
|
||||
matcherConfigurer.configureMatcher(genericPropertyMatcher);
|
||||
@@ -418,7 +418,7 @@ public interface ExampleMatcher {
|
||||
*/
|
||||
public GenericPropertyMatcher stringMatcher(StringMatcher stringMatcher) {
|
||||
|
||||
Assert.notNull(stringMatcher, "StringMatcher must not be null!");
|
||||
Assert.notNull(stringMatcher, "StringMatcher must not be null");
|
||||
this.stringMatcher = stringMatcher;
|
||||
return this;
|
||||
}
|
||||
@@ -431,7 +431,7 @@ public interface ExampleMatcher {
|
||||
*/
|
||||
public GenericPropertyMatcher transform(PropertyValueTransformer propertyValueTransformer) {
|
||||
|
||||
Assert.notNull(propertyValueTransformer, "PropertyValueTransformer must not be null!");
|
||||
Assert.notNull(propertyValueTransformer, "PropertyValueTransformer must not be null");
|
||||
this.valueTransformer = propertyValueTransformer;
|
||||
return this;
|
||||
}
|
||||
@@ -627,7 +627,7 @@ public interface ExampleMatcher {
|
||||
*/
|
||||
PropertySpecifier(String path) {
|
||||
|
||||
Assert.hasText(path, "Path must not be null/empty!");
|
||||
Assert.hasText(path, "Path must not be null/empty");
|
||||
this.path = path;
|
||||
|
||||
this.stringMatcher = null;
|
||||
@@ -652,7 +652,7 @@ public interface ExampleMatcher {
|
||||
*/
|
||||
public PropertySpecifier withStringMatcher(StringMatcher stringMatcher) {
|
||||
|
||||
Assert.notNull(stringMatcher, "StringMatcher must not be null!");
|
||||
Assert.notNull(stringMatcher, "StringMatcher must not be null");
|
||||
return new PropertySpecifier(this.path, stringMatcher, this.ignoreCase, this.valueTransformer);
|
||||
}
|
||||
|
||||
@@ -676,7 +676,7 @@ public interface ExampleMatcher {
|
||||
*/
|
||||
public PropertySpecifier withValueTransformer(PropertyValueTransformer valueTransformer) {
|
||||
|
||||
Assert.notNull(valueTransformer, "PropertyValueTransformer must not be null!");
|
||||
Assert.notNull(valueTransformer, "PropertyValueTransformer must not be null");
|
||||
return new PropertySpecifier(this.path, this.stringMatcher, this.ignoreCase, valueTransformer);
|
||||
}
|
||||
|
||||
@@ -785,7 +785,7 @@ public interface ExampleMatcher {
|
||||
|
||||
public void add(PropertySpecifier specifier) {
|
||||
|
||||
Assert.notNull(specifier, "PropertySpecifier must not be null!");
|
||||
Assert.notNull(specifier, "PropertySpecifier must not be null");
|
||||
propertySpecifiers.put(specifier.getPath(), specifier);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PageRequest extends AbstractPageRequest {
|
||||
|
||||
super(page, size);
|
||||
|
||||
Assert.notNull(sort, "Sort must not be null!");
|
||||
Assert.notNull(sort, "Sort must not be null");
|
||||
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public interface Pageable {
|
||||
*/
|
||||
default Sort getSortOr(Sort sort) {
|
||||
|
||||
Assert.notNull(sort, "Fallback Sort must not be null!");
|
||||
Assert.notNull(sort, "Fallback Sort must not be null");
|
||||
|
||||
return getSort().isSorted() ? getSort() : sort;
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ public final class Range<T> {
|
||||
|
||||
private Range(Bound<T> lowerBound, Bound<T> upperBound) {
|
||||
|
||||
Assert.notNull(lowerBound, "Lower bound must not be null!");
|
||||
Assert.notNull(upperBound, "Upper bound must not be null!");
|
||||
Assert.notNull(lowerBound, "Lower bound must not be null");
|
||||
Assert.notNull(upperBound, "Upper bound must not be null");
|
||||
|
||||
this.lowerBound = lowerBound;
|
||||
this.upperBound = upperBound;
|
||||
@@ -149,7 +149,7 @@ public final class Range<T> {
|
||||
*/
|
||||
public static <T> RangeBuilder<T> from(Bound<T> lower) {
|
||||
|
||||
Assert.notNull(lower, "Lower bound must not be null!");
|
||||
Assert.notNull(lower, "Lower bound must not be null");
|
||||
return new RangeBuilder<>(lower);
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ public final class Range<T> {
|
||||
*/
|
||||
public boolean contains(T value, Comparator<T> comparator) {
|
||||
|
||||
Assert.notNull(value, "Reference value must not be null!");
|
||||
Assert.notNull(value, "Reference value must not be null");
|
||||
|
||||
boolean greaterThanLowerBound = lowerBound.getValue() //
|
||||
.map(it -> lowerBound.isInclusive() ? comparator.compare(it, value) <= 0 : comparator.compare(it, value) < 0) //
|
||||
@@ -301,7 +301,7 @@ public final class Range<T> {
|
||||
*/
|
||||
public static <T> Bound<T> inclusive(T value) {
|
||||
|
||||
Assert.notNull(value, "Value must not be null!");
|
||||
Assert.notNull(value, "Value must not be null");
|
||||
return new Bound<>(Optional.of(value), true);
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ public final class Range<T> {
|
||||
*/
|
||||
public static <T> Bound<T> exclusive(T value) {
|
||||
|
||||
Assert.notNull(value, "Value must not be null!");
|
||||
Assert.notNull(value, "Value must not be null");
|
||||
return new Bound<>(Optional.of(value), false);
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ public final class Range<T> {
|
||||
*/
|
||||
public Range<T> to(Bound<T> upper) {
|
||||
|
||||
Assert.notNull(upper, "Upper bound must not be null!");
|
||||
Assert.notNull(upper, "Upper bound must not be null");
|
||||
return new Range<>(lower, upper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
*/
|
||||
public static Sort by(String... properties) {
|
||||
|
||||
Assert.notNull(properties, "Properties must not be null!");
|
||||
Assert.notNull(properties, "Properties must not be null");
|
||||
|
||||
return properties.length == 0 //
|
||||
? Sort.unsorted() //
|
||||
@@ -96,7 +96,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
*/
|
||||
public static Sort by(List<Order> orders) {
|
||||
|
||||
Assert.notNull(orders, "Orders must not be null!");
|
||||
Assert.notNull(orders, "Orders must not be null");
|
||||
|
||||
return orders.isEmpty() ? Sort.unsorted() : new Sort(orders);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
*/
|
||||
public static Sort by(Order... orders) {
|
||||
|
||||
Assert.notNull(orders, "Orders must not be null!");
|
||||
Assert.notNull(orders, "Orders must not be null");
|
||||
|
||||
return new Sort(Arrays.asList(orders));
|
||||
}
|
||||
@@ -123,9 +123,9 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
*/
|
||||
public static Sort by(Direction direction, String... properties) {
|
||||
|
||||
Assert.notNull(direction, "Direction must not be null!");
|
||||
Assert.notNull(properties, "Properties must not be null!");
|
||||
Assert.isTrue(properties.length > 0, "At least one property must be given!");
|
||||
Assert.notNull(direction, "Direction must not be null");
|
||||
Assert.notNull(properties, "Properties must not be null");
|
||||
Assert.isTrue(properties.length > 0, "At least one property must be given");
|
||||
|
||||
return Sort.by(Arrays.stream(properties)//
|
||||
.map(it -> new Order(direction, it))//
|
||||
@@ -192,7 +192,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
*/
|
||||
public Sort and(Sort sort) {
|
||||
|
||||
Assert.notNull(sort, "Sort must not be null!");
|
||||
Assert.notNull(sort, "Sort must not be null");
|
||||
|
||||
ArrayList<Order> these = new ArrayList<Order>(this.toList());
|
||||
|
||||
@@ -305,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
@Override
|
||||
public ExampleMatcher withIgnorePaths(String... ignoredPaths) {
|
||||
|
||||
Assert.notEmpty(ignoredPaths, "IgnoredPaths must not be empty!");
|
||||
Assert.noNullElements(ignoredPaths, "IgnoredPaths must not contain null elements!");
|
||||
Assert.notEmpty(ignoredPaths, "IgnoredPaths must not be empty");
|
||||
Assert.noNullElements(ignoredPaths, "IgnoredPaths must not contain null elements");
|
||||
|
||||
Set<String> newIgnoredPaths = new LinkedHashSet<>(this.ignoredPaths);
|
||||
newIgnoredPaths.addAll(Arrays.asList(ignoredPaths));
|
||||
@@ -71,7 +71,7 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
@Override
|
||||
public ExampleMatcher withStringMatcher(StringMatcher defaultStringMatcher) {
|
||||
|
||||
Assert.notNull(ignoredPaths, "DefaultStringMatcher must not be empty!");
|
||||
Assert.notNull(ignoredPaths, "DefaultStringMatcher must not be empty");
|
||||
|
||||
return new TypedExampleMatcher(nullHandler, defaultStringMatcher, propertySpecifiers, ignoredPaths,
|
||||
defaultIgnoreCase, mode);
|
||||
@@ -86,8 +86,8 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
@Override
|
||||
public ExampleMatcher withMatcher(String propertyPath, GenericPropertyMatcher genericPropertyMatcher) {
|
||||
|
||||
Assert.hasText(propertyPath, "PropertyPath must not be empty!");
|
||||
Assert.notNull(genericPropertyMatcher, "GenericPropertyMatcher must not be empty!");
|
||||
Assert.hasText(propertyPath, "PropertyPath must not be empty");
|
||||
Assert.notNull(genericPropertyMatcher, "GenericPropertyMatcher must not be empty");
|
||||
|
||||
PropertySpecifiers propertySpecifiers = new PropertySpecifiers(this.propertySpecifiers);
|
||||
PropertySpecifier propertySpecifier = new PropertySpecifier(propertyPath);
|
||||
@@ -111,8 +111,8 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
@Override
|
||||
public ExampleMatcher withTransformer(String propertyPath, PropertyValueTransformer propertyValueTransformer) {
|
||||
|
||||
Assert.hasText(propertyPath, "PropertyPath must not be empty!");
|
||||
Assert.notNull(propertyValueTransformer, "PropertyValueTransformer must not be empty!");
|
||||
Assert.hasText(propertyPath, "PropertyPath must not be empty");
|
||||
Assert.notNull(propertyValueTransformer, "PropertyValueTransformer must not be empty");
|
||||
|
||||
PropertySpecifiers propertySpecifiers = new PropertySpecifiers(this.propertySpecifiers);
|
||||
PropertySpecifier propertySpecifier = getOrCreatePropertySpecifier(propertyPath, propertySpecifiers);
|
||||
@@ -126,8 +126,8 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
@Override
|
||||
public ExampleMatcher withIgnoreCase(String... propertyPaths) {
|
||||
|
||||
Assert.notEmpty(propertyPaths, "PropertyPaths must not be empty!");
|
||||
Assert.noNullElements(propertyPaths, "PropertyPaths must not contain null elements!");
|
||||
Assert.notEmpty(propertyPaths, "PropertyPaths must not be empty");
|
||||
Assert.noNullElements(propertyPaths, "PropertyPaths must not contain null elements");
|
||||
|
||||
PropertySpecifiers propertySpecifiers = new PropertySpecifiers(this.propertySpecifiers);
|
||||
|
||||
@@ -143,7 +143,7 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
@Override
|
||||
public ExampleMatcher withNullHandler(NullHandler nullHandler) {
|
||||
|
||||
Assert.notNull(nullHandler, "NullHandler must not be null!");
|
||||
Assert.notNull(nullHandler, "NullHandler must not be null");
|
||||
return new TypedExampleMatcher(nullHandler, defaultStringMatcher, propertySpecifiers, ignoredPaths,
|
||||
defaultIgnoreCase, mode);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public abstract class SpringDataJaxb {
|
||||
*/
|
||||
public static <T, S> List<T> unmarshal(Collection<S> source, XmlAdapter<S, T> adapter) {
|
||||
|
||||
Assert.notNull(adapter, "Adapter must not be null!");
|
||||
Assert.notNull(adapter, "Adapter must not be null");
|
||||
|
||||
if (source == null || source.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
@@ -138,7 +138,7 @@ public abstract class SpringDataJaxb {
|
||||
*/
|
||||
public static <T, S> List<S> marshal(@Nullable Iterable<T> source, XmlAdapter<S, T> adapter) {
|
||||
|
||||
Assert.notNull(adapter, "Adapter must not be null!");
|
||||
Assert.notNull(adapter, "Adapter must not be null");
|
||||
|
||||
if (source == null) {
|
||||
return Collections.emptyList();
|
||||
|
||||
Reference in New Issue
Block a user