Browse Source

Remove punctuation in Exception messages.

Closes #4079.
pull/4093/head
John Blum 4 years ago
parent
commit
f15fd2a418
  1. 2
      spring-data-mongodb-benchmarks/src/main/java/org/springframework/data/mongodb/microbenchmark/AbstractMicrobenchmark.java
  2. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/CodecRegistryProvider.java
  3. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoDatabaseUtils.java
  4. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoResourceHolder.java
  5. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoTransactionManager.java
  6. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoDatabaseUtils.java
  7. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoTransactionManager.java
  8. 14
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/SessionAwareMethodInterceptor.java
  9. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MappingMongoConverterParser.java
  10. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoAuditingRegistrar.java
  11. 12
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoCredentialPropertyEditor.java
  12. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoDbFactoryParser.java
  13. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ReactiveMongoAuditingRegistrar.java
  14. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ServerAddressPropertyEditor.java
  15. 14
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ChangeStreamOptions.java
  16. 12
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/CollectionOptions.java
  17. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/CountQuery.java
  18. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/CursorPreparer.java
  19. 40
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultBulkOperations.java
  20. 12
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultIndexOperations.java
  21. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultReactiveIndexOperations.java
  22. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultScriptOperations.java
  23. 20
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EntityOperations.java
  24. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableAggregationOperationSupport.java
  25. 16
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableFindOperationSupport.java
  26. 12
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableInsertOperationSupport.java
  27. 16
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableMapReduceOperationSupport.java
  28. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableRemoveOperationSupport.java
  29. 16
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableUpdateOperationSupport.java
  30. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndModifyOptions.java
  31. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndReplaceOptions.java
  32. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindPublisherPreparer.java
  33. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/GeoCommandStatistics.java
  34. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MappingMongoJsonSchemaCreator.java
  35. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAction.java
  36. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAdmin.java
  37. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoClientFactoryBean.java
  38. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDataIntegrityViolationException.java
  39. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDatabaseFactorySupport.java
  40. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoJsonSchemaCreator.java
  41. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java
  42. 222
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java
  43. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveAggregationOperationSupport.java
  44. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveChangeStreamOperationSupport.java
  45. 16
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveFindOperationSupport.java
  46. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveInsertOperationSupport.java
  47. 14
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMapReduceOperationSupport.java
  48. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoClientFactoryBean.java
  49. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoContext.java
  50. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java
  51. 138
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java
  52. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveRemoveOperationSupport.java
  53. 16
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveUpdateOperationSupport.java
  54. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/SimpleReactiveMongoDatabaseFactory.java
  55. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AbstractAggregationExpression.java
  56. 58
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AccumulatorOperators.java
  57. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java
  58. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationExpressionTransformer.java
  59. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationContext.java
  60. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java
  61. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationPipeline.java
  62. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationResults.java
  63. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationSpELExpression.java
  64. 16
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUpdate.java
  65. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUtils.java
  66. 196
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArithmeticOperators.java
  67. 118
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArrayOperators.java
  68. 30
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BooleanOperators.java
  69. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketAutoOperation.java
  70. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketOperation.java
  71. 30
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketOperationSupport.java
  72. 74
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ComparisonOperators.java
  73. 64
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConditionalOperators.java
  74. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java
  75. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/CountOperation.java
  76. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DataTypeOperators.java
  77. 158
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DateOperators.java
  78. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DocumentEnhancingOperation.java
  79. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/EvaluationOperators.java
  80. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFields.java
  81. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFieldsAggregationOperationContext.java
  82. 14
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/FacetOperation.java
  83. 14
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Fields.java
  84. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GeoNearOperation.java
  85. 26
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GraphLookupOperation.java
  86. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GroupOperation.java
  87. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LimitOperation.java
  88. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LiteralOperators.java
  89. 16
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LookupOperation.java
  90. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MatchOperation.java
  91. 12
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MergeOperation.java
  92. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/NestedDelegatingExpressionAggregationOperationContext.java
  93. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ObjectOperators.java
  94. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/OutOperation.java
  95. 64
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java
  96. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java
  97. 22
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceRootOperation.java
  98. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceWithOperation.java
  99. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SampleOperation.java
  100. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ScriptOperators.java
  101. Some files were not shown because too many files have changed in this diff Show More

2
spring-data-mongodb-benchmarks/src/main/java/org/springframework/data/mongodb/microbenchmark/AbstractMicrobenchmark.java

@ -322,7 +322,7 @@ public class AbstractMicrobenchmark { @@ -322,7 +322,7 @@ public class AbstractMicrobenchmark {
try {
ResultsWriter.forUri(uri).write(results);
} catch (Exception e) {
System.err.println(String.format("Cannot save benchmark results to '%s'. Error was %s.", uri, e));
System.err.println(String.format("Cannot save benchmark results to '%s'; Error was %s", uri, e));
}
}
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/CodecRegistryProvider.java

@ -62,7 +62,7 @@ public interface CodecRegistryProvider { @@ -62,7 +62,7 @@ public interface CodecRegistryProvider {
*/
default <T> Optional<Codec<T>> getCodecFor(Class<T> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
try {
return Optional.of(getCodecRegistry().get(type));

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoDatabaseUtils.java

@ -102,7 +102,7 @@ public class MongoDatabaseUtils { @@ -102,7 +102,7 @@ public class MongoDatabaseUtils {
private static MongoDatabase doGetMongoDatabase(@Nullable String dbName, MongoDatabaseFactory factory,
SessionSynchronization sessionSynchronization) {
Assert.notNull(factory, "Factory must not be null!");
Assert.notNull(factory, "Factory must not be null");
if (sessionSynchronization == SessionSynchronization.NEVER
|| !TransactionSynchronizationManager.isSynchronizationActive()) {

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoResourceHolder.java

@ -68,7 +68,7 @@ class MongoResourceHolder extends ResourceHolderSupport { @@ -68,7 +68,7 @@ class MongoResourceHolder extends ResourceHolderSupport {
ClientSession session = getSession();
if (session == null) {
throw new IllegalStateException("No session available!");
throw new IllegalStateException("No session available");
}
return session;

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoTransactionManager.java

@ -100,7 +100,7 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager @@ -100,7 +100,7 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager
*/
public MongoTransactionManager(MongoDatabaseFactory dbFactory, @Nullable TransactionOptions options) {
Assert.notNull(dbFactory, "DbFactory must not be null!");
Assert.notNull(dbFactory, "DbFactory must not be null");
this.dbFactory = dbFactory;
this.options = options;
@ -266,7 +266,7 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager @@ -266,7 +266,7 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager
*/
public void setDbFactory(MongoDatabaseFactory dbFactory) {
Assert.notNull(dbFactory, "DbFactory must not be null!");
Assert.notNull(dbFactory, "DbFactory must not be null");
this.dbFactory = dbFactory;
}
@ -315,7 +315,7 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager @@ -315,7 +315,7 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager
private MongoDatabaseFactory getRequiredDbFactory() {
Assert.state(dbFactory != null,
"MongoTransactionManager operates upon a MongoDbFactory. Did you forget to provide one? It's required.");
"MongoTransactionManager operates upon a MongoDbFactory; Did you forget to provide one; It's required");
return dbFactory;
}
@ -450,14 +450,14 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager @@ -450,14 +450,14 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager
private MongoResourceHolder getRequiredResourceHolder() {
Assert.state(resourceHolder != null, "MongoResourceHolder is required but not present. o_O");
Assert.state(resourceHolder != null, "MongoResourceHolder is required but not present; o_O");
return resourceHolder;
}
private ClientSession getRequiredSession() {
ClientSession session = getSession();
Assert.state(session != null, "A Session is required but it turned out to be null.");
Assert.state(session != null, "A Session is required but it turned out to be null");
return session;
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoDatabaseUtils.java

@ -136,7 +136,7 @@ public class ReactiveMongoDatabaseUtils { @@ -136,7 +136,7 @@ public class ReactiveMongoDatabaseUtils {
private static Mono<MongoDatabase> doGetMongoDatabase(@Nullable String dbName, ReactiveMongoDatabaseFactory factory,
SessionSynchronization sessionSynchronization) {
Assert.notNull(factory, "DatabaseFactory must not be null!");
Assert.notNull(factory, "DatabaseFactory must not be null");
if (sessionSynchronization == SessionSynchronization.NEVER) {
return getMongoDatabaseOrDefault(dbName, factory);

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoTransactionManager.java

@ -104,7 +104,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction @@ -104,7 +104,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
public ReactiveMongoTransactionManager(ReactiveMongoDatabaseFactory databaseFactory,
@Nullable TransactionOptions options) {
Assert.notNull(databaseFactory, "DatabaseFactory must not be null!");
Assert.notNull(databaseFactory, "DatabaseFactory must not be null");
this.databaseFactory = databaseFactory;
this.options = options;
@ -281,7 +281,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction @@ -281,7 +281,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
*/
public void setDatabaseFactory(ReactiveMongoDatabaseFactory databaseFactory) {
Assert.notNull(databaseFactory, "DatabaseFactory must not be null!");
Assert.notNull(databaseFactory, "DatabaseFactory must not be null");
this.databaseFactory = databaseFactory;
}
@ -323,7 +323,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction @@ -323,7 +323,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
private ReactiveMongoDatabaseFactory getRequiredDatabaseFactory() {
Assert.state(databaseFactory != null,
"ReactiveMongoTransactionManager operates upon a ReactiveMongoDatabaseFactory. Did you forget to provide one? It's required.");
"ReactiveMongoTransactionManager operates upon a ReactiveMongoDatabaseFactory; Did you forget to provide one; It's required");
return databaseFactory;
}
@ -458,14 +458,14 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction @@ -458,14 +458,14 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
private ReactiveMongoResourceHolder getRequiredResourceHolder() {
Assert.state(resourceHolder != null, "ReactiveMongoResourceHolder is required but not present. o_O");
Assert.state(resourceHolder != null, "ReactiveMongoResourceHolder is required but not present; o_O");
return resourceHolder;
}
private ClientSession getRequiredSession() {
ClientSession session = getSession();
Assert.state(session != null, "A Session is required but it turned out to be null.");
Assert.state(session != null, "A Session is required but it turned out to be null");
return session;
}

14
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/SessionAwareMethodInterceptor.java

@ -76,13 +76,13 @@ public class SessionAwareMethodInterceptor<D, C> implements MethodInterceptor { @@ -76,13 +76,13 @@ public class SessionAwareMethodInterceptor<D, C> implements MethodInterceptor {
Class<D> databaseType, ClientSessionOperator<D> databaseDecorator, Class<C> collectionType,
ClientSessionOperator<C> collectionDecorator) {
Assert.notNull(session, "ClientSession must not be null!");
Assert.notNull(target, "Target must not be null!");
Assert.notNull(sessionType, "SessionType must not be null!");
Assert.notNull(databaseType, "Database type must not be null!");
Assert.notNull(databaseDecorator, "Database ClientSessionOperator must not be null!");
Assert.notNull(collectionType, "Collection type must not be null!");
Assert.notNull(collectionDecorator, "Collection ClientSessionOperator must not be null!");
Assert.notNull(session, "ClientSession must not be null");
Assert.notNull(target, "Target must not be null");
Assert.notNull(sessionType, "SessionType must not be null");
Assert.notNull(databaseType, "Database type must not be null");
Assert.notNull(databaseDecorator, "Database ClientSessionOperator must not be null");
Assert.notNull(collectionType, "Collection type must not be null");
Assert.notNull(collectionDecorator, "Collection ClientSessionOperator must not be null");
this.session = session;
this.target = target;

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MappingMongoConverterParser.java

@ -255,7 +255,7 @@ public class MappingMongoConverterParser implements BeanDefinitionParser { @@ -255,7 +255,7 @@ public class MappingMongoConverterParser implements BeanDefinitionParser {
&& Boolean.parseBoolean(abbreviateFieldNames);
if (fieldNamingStrategyReferenced && abbreviationActivated) {
context.error("Field name abbreviation cannot be activated if a field-naming-strategy-ref is configured!",
context.error("Field name abbreviation cannot be activated if a field-naming-strategy-ref is configured",
element);
return;
}

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoAuditingRegistrar.java

@ -55,8 +55,8 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport { @@ -55,8 +55,8 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
@Override
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null!");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
super.registerBeanDefinitions(annotationMetadata, registry);
}
@ -64,7 +64,7 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport { @@ -64,7 +64,7 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
@Override
protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) {
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
Assert.notNull(configuration, "AuditingConfiguration must not be null");
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(IsNewAwareAuditingHandler.class);
@ -79,8 +79,8 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport { @@ -79,8 +79,8 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
protected void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition,
BeanDefinitionRegistry registry) {
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null!");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
BeanDefinitionBuilder listenerBeanDefinitionBuilder = BeanDefinitionBuilder
.rootBeanDefinition(AuditingEntityCallback.class);

12
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoCredentialPropertyEditor.java

@ -117,7 +117,7 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport { @@ -117,7 +117,7 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport {
userNameAndPassword[1].toCharArray()));
} else {
throw new IllegalArgumentException(
String.format("Cannot create MongoCredentials for unknown auth mechanism '%s'!", authMechanism));
String.format("Cannot create MongoCredentials for unknown auth mechanism '%s'", authMechanism));
}
}
} else {
@ -194,7 +194,7 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport { @@ -194,7 +194,7 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport {
String[] optionArgs = option.split("=");
if (optionArgs.length == 1) {
throw new IllegalArgumentException(String.format("Query parameter '%s' has no value!", optionArgs[0]));
throw new IllegalArgumentException(String.format("Query parameter '%s' has no value", optionArgs[0]));
}
properties.put(optionArgs[0], optionArgs[1]);
@ -209,21 +209,21 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport { @@ -209,21 +209,21 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport {
if (source.length != 2) {
throw new IllegalArgumentException(
"Credentials need to specify username and password like in 'username:password@database'!");
"Credentials need to specify username and password like in 'username:password@database'");
}
}
private static void verifyDatabasePresent(String source) {
if (!StringUtils.hasText(source)) {
throw new IllegalArgumentException("Credentials need to specify database like in 'username:password@database'!");
throw new IllegalArgumentException("Credentials need to specify database like in 'username:password@database'");
}
}
private static void verifyUserNamePresent(String[] source) {
if (source.length == 0 || !StringUtils.hasText(source[0])) {
throw new IllegalArgumentException("Credentials need to specify username!");
throw new IllegalArgumentException("Credentials need to specify username");
}
}
@ -231,7 +231,7 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport { @@ -231,7 +231,7 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport {
try {
return URLDecoder.decode(it, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new IllegalArgumentException("o_O UTF-8 not supported!", e);
throw new IllegalArgumentException("o_O UTF-8 not supported", e);
}
}
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoDbFactoryParser.java

@ -163,7 +163,7 @@ public class MongoDbFactoryParser extends AbstractBeanDefinitionParser { @@ -163,7 +163,7 @@ public class MongoDbFactoryParser extends AbstractBeanDefinitionParser {
if (element.getAttributes().getLength() > allowedAttributesCount) {
parserContext.getReaderContext().error("Configure either MongoDB " + type + " or details individually!",
parserContext.getReaderContext().error("Configure either MongoDB " + type + " or details individually",
parserContext.extractSource(element));
}

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ReactiveMongoAuditingRegistrar.java

@ -51,7 +51,7 @@ class ReactiveMongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupp @@ -51,7 +51,7 @@ class ReactiveMongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupp
@Override
protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) {
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
Assert.notNull(configuration, "AuditingConfiguration must not be null");
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ReactiveIsNewAwareAuditingHandler.class);
@ -66,8 +66,8 @@ class ReactiveMongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupp @@ -66,8 +66,8 @@ class ReactiveMongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupp
protected void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition,
BeanDefinitionRegistry registry) {
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null!");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ReactiveAuditingEntityCallback.class);

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ServerAddressPropertyEditor.java

@ -43,7 +43,7 @@ public class ServerAddressPropertyEditor extends PropertyEditorSupport { @@ -43,7 +43,7 @@ public class ServerAddressPropertyEditor extends PropertyEditorSupport {
* A port is a number without a leading 0 at the end of the address that is proceeded by just a single :.
*/
private static final String HOST_PORT_SPLIT_PATTERN = "(?<!:):(?=[123456789]\\d*$)";
private static final String COULD_NOT_PARSE_ADDRESS_MESSAGE = "Could not parse address %s '%s'. Check your replica set configuration!";
private static final String COULD_NOT_PARSE_ADDRESS_MESSAGE = "Could not parse address %s '%s'; Check your replica set configuration";
private static final Log LOG = LogFactory.getLog(ServerAddressPropertyEditor.class);
@Override
@ -68,7 +68,7 @@ public class ServerAddressPropertyEditor extends PropertyEditorSupport { @@ -68,7 +68,7 @@ public class ServerAddressPropertyEditor extends PropertyEditorSupport {
if (serverAddresses.isEmpty()) {
throw new IllegalArgumentException(
"Could not resolve at least one server of the replica set configuration! Validate your config!");
"Could not resolve at least one server of the replica set configuration; Validate your config");
}
setValue(serverAddresses.toArray(new ServerAddress[serverAddresses.size()]));
@ -125,7 +125,7 @@ public class ServerAddressPropertyEditor extends PropertyEditorSupport { @@ -125,7 +125,7 @@ public class ServerAddressPropertyEditor extends PropertyEditorSupport {
*/
private String[] extractHostAddressAndPort(String addressAndPortSource) {
Assert.notNull(addressAndPortSource, "Address and port source must not be null!");
Assert.notNull(addressAndPortSource, "Address and port source must not be null");
String[] hostAndPort = addressAndPortSource.split(HOST_PORT_SPLIT_PATTERN);
String hostAddress = hostAndPort[0];

14
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ChangeStreamOptions.java

@ -148,7 +148,7 @@ public class ChangeStreamOptions { @@ -148,7 +148,7 @@ public class ChangeStreamOptions {
}
throw new IllegalArgumentException(
"o_O that should actually not happen. The timestamp should be an Instant or a BsonTimestamp but was "
"o_O that should actually not happen; The timestamp should be an Instant or a BsonTimestamp but was "
+ ObjectUtils.nullSafeClassName(timestamp));
}
@ -234,7 +234,7 @@ public class ChangeStreamOptions { @@ -234,7 +234,7 @@ public class ChangeStreamOptions {
*/
public ChangeStreamOptionsBuilder collation(Collation collation) {
Assert.notNull(collation, "Collation must not be null nor empty!");
Assert.notNull(collation, "Collation must not be null nor empty");
this.collation = collation;
return this;
@ -258,7 +258,7 @@ public class ChangeStreamOptions { @@ -258,7 +258,7 @@ public class ChangeStreamOptions {
*/
public ChangeStreamOptionsBuilder filter(Aggregation filter) {
Assert.notNull(filter, "Filter must not be null!");
Assert.notNull(filter, "Filter must not be null");
this.filter = filter;
return this;
@ -287,7 +287,7 @@ public class ChangeStreamOptions { @@ -287,7 +287,7 @@ public class ChangeStreamOptions {
*/
public ChangeStreamOptionsBuilder resumeToken(BsonValue resumeToken) {
Assert.notNull(resumeToken, "ResumeToken must not be null!");
Assert.notNull(resumeToken, "ResumeToken must not be null");
this.resumeToken = resumeToken;
@ -316,7 +316,7 @@ public class ChangeStreamOptions { @@ -316,7 +316,7 @@ public class ChangeStreamOptions {
*/
public ChangeStreamOptionsBuilder fullDocumentLookup(FullDocument lookup) {
Assert.notNull(lookup, "Lookup must not be null!");
Assert.notNull(lookup, "Lookup must not be null");
this.fullDocumentLookup = lookup;
return this;
@ -330,7 +330,7 @@ public class ChangeStreamOptions { @@ -330,7 +330,7 @@ public class ChangeStreamOptions {
*/
public ChangeStreamOptionsBuilder resumeAt(Instant resumeTimestamp) {
Assert.notNull(resumeTimestamp, "ResumeTimestamp must not be null!");
Assert.notNull(resumeTimestamp, "ResumeTimestamp must not be null");
this.resumeTimestamp = resumeTimestamp;
return this;
@ -345,7 +345,7 @@ public class ChangeStreamOptions { @@ -345,7 +345,7 @@ public class ChangeStreamOptions {
*/
public ChangeStreamOptionsBuilder resumeAt(BsonTimestamp resumeTimestamp) {
Assert.notNull(resumeTimestamp, "ResumeTimestamp must not be null!");
Assert.notNull(resumeTimestamp, "ResumeTimestamp must not be null");
this.resumeTimestamp = resumeTimestamp;
return this;

12
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/CollectionOptions.java

@ -68,7 +68,7 @@ public class CollectionOptions { @@ -68,7 +68,7 @@ public class CollectionOptions {
*/
public static CollectionOptions just(Collation collation) {
Assert.notNull(collation, "Collation must not be null!");
Assert.notNull(collation, "Collation must not be null");
return new CollectionOptions(null, null, null, collation, ValidationOptions.none(), null);
}
@ -230,7 +230,7 @@ public class CollectionOptions { @@ -230,7 +230,7 @@ public class CollectionOptions {
*/
public CollectionOptions schemaValidationLevel(ValidationLevel validationLevel) {
Assert.notNull(validationLevel, "ValidationLevel must not be null!");
Assert.notNull(validationLevel, "ValidationLevel must not be null");
return validation(validationOptions.validationLevel(validationLevel));
}
@ -244,7 +244,7 @@ public class CollectionOptions { @@ -244,7 +244,7 @@ public class CollectionOptions {
*/
public CollectionOptions schemaValidationAction(ValidationAction validationAction) {
Assert.notNull(validationAction, "ValidationAction must not be null!");
Assert.notNull(validationAction, "ValidationAction must not be null");
return validation(validationOptions.validationAction(validationAction));
}
@ -257,7 +257,7 @@ public class CollectionOptions { @@ -257,7 +257,7 @@ public class CollectionOptions {
*/
public CollectionOptions validation(ValidationOptions validationOptions) {
Assert.notNull(validationOptions, "ValidationOptions must not be null!");
Assert.notNull(validationOptions, "ValidationOptions must not be null");
return new CollectionOptions(size, maxDocuments, capped, collation, validationOptions, timeSeriesOptions);
}
@ -270,7 +270,7 @@ public class CollectionOptions { @@ -270,7 +270,7 @@ public class CollectionOptions {
*/
public CollectionOptions timeSeries(TimeSeriesOptions timeSeriesOptions) {
Assert.notNull(timeSeriesOptions, "TimeSeriesOptions must not be null!");
Assert.notNull(timeSeriesOptions, "TimeSeriesOptions must not be null");
return new CollectionOptions(size, maxDocuments, capped, collation, validationOptions, timeSeriesOptions);
}
@ -446,7 +446,7 @@ public class CollectionOptions { @@ -446,7 +446,7 @@ public class CollectionOptions {
private TimeSeriesOptions(String timeField, @Nullable String metaField, GranularityDefinition granularity) {
Assert.hasText(timeField, "Time field must not be empty or null!");
Assert.hasText(timeField, "Time field must not be empty or null");
this.timeField = timeField;
this.metaField = metaField;

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/CountQuery.java

@ -183,7 +183,7 @@ class CountQuery { @@ -183,7 +183,7 @@ class CountQuery {
criteria.addAll((Collection) $and);
} else {
throw new IllegalArgumentException(
"Cannot rewrite query as it contains an '$and' element that is not a Collection!: Offending element: "
"Cannot rewrite query as it contains an '$and' element that is not a Collection: Offending element: "
+ $and);
}
}

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/CursorPreparer.java

@ -61,8 +61,8 @@ public interface CursorPreparer extends ReadPreferenceAware { @@ -61,8 +61,8 @@ public interface CursorPreparer extends ReadPreferenceAware {
default FindIterable<Document> initiateFind(MongoCollection<Document> collection,
Function<MongoCollection<Document>, FindIterable<Document>> find) {
Assert.notNull(collection, "Collection must not be null!");
Assert.notNull(find, "Find function must not be null!");
Assert.notNull(collection, "Collection must not be null");
Assert.notNull(find, "Find function must not be null");
if (hasReadPreference()) {
collection = collection.withReadPreference(getReadPreference());

40
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultBulkOperations.java

@ -90,9 +90,9 @@ class DefaultBulkOperations implements BulkOperations { @@ -90,9 +90,9 @@ class DefaultBulkOperations implements BulkOperations {
DefaultBulkOperations(MongoOperations mongoOperations, String collectionName,
BulkOperationContext bulkOperationContext) {
Assert.notNull(mongoOperations, "MongoOperations must not be null!");
Assert.hasText(collectionName, "CollectionName must not be null nor empty!");
Assert.notNull(bulkOperationContext, "BulkOperationContext must not be null!");
Assert.notNull(mongoOperations, "MongoOperations must not be null");
Assert.hasText(collectionName, "CollectionName must not be null nor empty");
Assert.notNull(bulkOperationContext, "BulkOperationContext must not be null");
this.mongoOperations = mongoOperations;
this.collectionName = collectionName;
@ -112,7 +112,7 @@ class DefaultBulkOperations implements BulkOperations { @@ -112,7 +112,7 @@ class DefaultBulkOperations implements BulkOperations {
@Override
public BulkOperations insert(Object document) {
Assert.notNull(document, "Document must not be null!");
Assert.notNull(document, "Document must not be null");
maybeEmitEvent(new BeforeConvertEvent<>(document, collectionName));
Object source = maybeInvokeBeforeConvertCallback(document);
@ -124,7 +124,7 @@ class DefaultBulkOperations implements BulkOperations { @@ -124,7 +124,7 @@ class DefaultBulkOperations implements BulkOperations {
@Override
public BulkOperations insert(List<? extends Object> documents) {
Assert.notNull(documents, "Documents must not be null!");
Assert.notNull(documents, "Documents must not be null");
documents.forEach(this::insert);
@ -135,8 +135,8 @@ class DefaultBulkOperations implements BulkOperations { @@ -135,8 +135,8 @@ class DefaultBulkOperations implements BulkOperations {
@SuppressWarnings("unchecked")
public BulkOperations updateOne(Query query, Update update) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(update, "Update must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(update, "Update must not be null");
return updateOne(Collections.singletonList(Pair.of(query, update)));
}
@ -144,7 +144,7 @@ class DefaultBulkOperations implements BulkOperations { @@ -144,7 +144,7 @@ class DefaultBulkOperations implements BulkOperations {
@Override
public BulkOperations updateOne(List<Pair<Query, Update>> updates) {
Assert.notNull(updates, "Updates must not be null!");
Assert.notNull(updates, "Updates must not be null");
for (Pair<Query, Update> update : updates) {
update(update.getFirst(), update.getSecond(), false, false);
@ -157,8 +157,8 @@ class DefaultBulkOperations implements BulkOperations { @@ -157,8 +157,8 @@ class DefaultBulkOperations implements BulkOperations {
@SuppressWarnings("unchecked")
public BulkOperations updateMulti(Query query, Update update) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(update, "Update must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(update, "Update must not be null");
return updateMulti(Collections.singletonList(Pair.of(query, update)));
}
@ -166,7 +166,7 @@ class DefaultBulkOperations implements BulkOperations { @@ -166,7 +166,7 @@ class DefaultBulkOperations implements BulkOperations {
@Override
public BulkOperations updateMulti(List<Pair<Query, Update>> updates) {
Assert.notNull(updates, "Updates must not be null!");
Assert.notNull(updates, "Updates must not be null");
for (Pair<Query, Update> update : updates) {
update(update.getFirst(), update.getSecond(), false, true);
@ -193,7 +193,7 @@ class DefaultBulkOperations implements BulkOperations { @@ -193,7 +193,7 @@ class DefaultBulkOperations implements BulkOperations {
@Override
public BulkOperations remove(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
DeleteOptions deleteOptions = new DeleteOptions();
query.getCollation().map(Collation::toMongoCollation).ifPresent(deleteOptions::collation);
@ -206,7 +206,7 @@ class DefaultBulkOperations implements BulkOperations { @@ -206,7 +206,7 @@ class DefaultBulkOperations implements BulkOperations {
@Override
public BulkOperations remove(List<Query> removes) {
Assert.notNull(removes, "Removals must not be null!");
Assert.notNull(removes, "Removals must not be null");
for (Query query : removes) {
remove(query);
@ -218,9 +218,9 @@ class DefaultBulkOperations implements BulkOperations { @@ -218,9 +218,9 @@ class DefaultBulkOperations implements BulkOperations {
@Override
public BulkOperations replaceOne(Query query, Object replacement, FindAndReplaceOptions options) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(replacement, "Replacement must not be null!");
Assert.notNull(options, "Options must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(replacement, "Replacement must not be null");
Assert.notNull(options, "Options must not be null");
ReplaceOptions replaceOptions = new ReplaceOptions();
replaceOptions.upsert(options.isUpsert());
@ -241,7 +241,7 @@ class DefaultBulkOperations implements BulkOperations { @@ -241,7 +241,7 @@ class DefaultBulkOperations implements BulkOperations {
com.mongodb.bulk.BulkWriteResult result = mongoOperations.execute(collectionName, this::bulkWriteTo);
Assert.state(result != null, "Result must not be null.");
Assert.state(result != null, "Result must not be null");
models.forEach(this::maybeEmitAfterSaveEvent);
models.forEach(this::maybeInvokeAfterSaveCallback);
@ -308,8 +308,8 @@ class DefaultBulkOperations implements BulkOperations { @@ -308,8 +308,8 @@ class DefaultBulkOperations implements BulkOperations {
*/
private BulkOperations update(Query query, Update update, boolean upsert, boolean multi) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(update, "Update must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(update, "Update must not be null");
UpdateOptions options = computeUpdateOptions(query, update, upsert);
@ -470,7 +470,7 @@ class DefaultBulkOperations implements BulkOperations { @@ -470,7 +470,7 @@ class DefaultBulkOperations implements BulkOperations {
return options.ordered(false);
}
throw new IllegalStateException("BulkMode was null!");
throw new IllegalStateException("BulkMode was null");
}
/**

12
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultIndexOperations.java

@ -83,9 +83,9 @@ public class DefaultIndexOperations implements IndexOperations { @@ -83,9 +83,9 @@ public class DefaultIndexOperations implements IndexOperations {
public DefaultIndexOperations(MongoDatabaseFactory mongoDbFactory, String collectionName, QueryMapper queryMapper,
@Nullable Class<?> type) {
Assert.notNull(mongoDbFactory, "MongoDbFactory must not be null!");
Assert.notNull(collectionName, "Collection name can not be null!");
Assert.notNull(queryMapper, "QueryMapper must not be null!");
Assert.notNull(mongoDbFactory, "MongoDbFactory must not be null");
Assert.notNull(collectionName, "Collection name can not be null");
Assert.notNull(queryMapper, "QueryMapper must not be null");
this.collectionName = collectionName;
this.mapper = queryMapper;
@ -103,8 +103,8 @@ public class DefaultIndexOperations implements IndexOperations { @@ -103,8 +103,8 @@ public class DefaultIndexOperations implements IndexOperations {
*/
public DefaultIndexOperations(MongoOperations mongoOperations, String collectionName, @Nullable Class<?> type) {
Assert.notNull(mongoOperations, "MongoOperations must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(mongoOperations, "MongoOperations must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
this.mongoOperations = mongoOperations;
this.mapper = new QueryMapper(mongoOperations.getConverter());
@ -189,7 +189,7 @@ public class DefaultIndexOperations implements IndexOperations { @@ -189,7 +189,7 @@ public class DefaultIndexOperations implements IndexOperations {
@Nullable
public <T> T execute(CollectionCallback<T> callback) {
Assert.notNull(callback, "CollectionCallback must not be null!");
Assert.notNull(callback, "CollectionCallback must not be null");
if (type != null) {
return mongoOperations.execute(type, callback);

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultReactiveIndexOperations.java

@ -76,9 +76,9 @@ public class DefaultReactiveIndexOperations implements ReactiveIndexOperations { @@ -76,9 +76,9 @@ public class DefaultReactiveIndexOperations implements ReactiveIndexOperations {
private DefaultReactiveIndexOperations(ReactiveMongoOperations mongoOperations, String collectionName,
QueryMapper queryMapper, Optional<Class<?>> type) {
Assert.notNull(mongoOperations, "ReactiveMongoOperations must not be null!");
Assert.notNull(collectionName, "Collection must not be null!");
Assert.notNull(queryMapper, "QueryMapper must not be null!");
Assert.notNull(mongoOperations, "ReactiveMongoOperations must not be null");
Assert.notNull(collectionName, "Collection must not be null");
Assert.notNull(queryMapper, "QueryMapper must not be null");
this.mongoOperations = mongoOperations;
this.collectionName = collectionName;

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultScriptOperations.java

@ -65,7 +65,7 @@ class DefaultScriptOperations implements ScriptOperations { @@ -65,7 +65,7 @@ class DefaultScriptOperations implements ScriptOperations {
*/
public DefaultScriptOperations(MongoOperations mongoOperations) {
Assert.notNull(mongoOperations, "MongoOperations must not be null!");
Assert.notNull(mongoOperations, "MongoOperations must not be null");
this.mongoOperations = mongoOperations;
}
@ -78,7 +78,7 @@ class DefaultScriptOperations implements ScriptOperations { @@ -78,7 +78,7 @@ class DefaultScriptOperations implements ScriptOperations {
@Override
public NamedMongoScript register(NamedMongoScript script) {
Assert.notNull(script, "Script must not be null!");
Assert.notNull(script, "Script must not be null");
mongoOperations.save(script, SCRIPT_COLLECTION_NAME);
return script;
@ -87,7 +87,7 @@ class DefaultScriptOperations implements ScriptOperations { @@ -87,7 +87,7 @@ class DefaultScriptOperations implements ScriptOperations {
@Override
public Object execute(final ExecutableMongoScript script, final Object... args) {
Assert.notNull(script, "Script must not be null!");
Assert.notNull(script, "Script must not be null");
return mongoOperations.execute(new DbCallback<Object>() {
@ -106,7 +106,7 @@ class DefaultScriptOperations implements ScriptOperations { @@ -106,7 +106,7 @@ class DefaultScriptOperations implements ScriptOperations {
@Override
public Object call(final String scriptName, final Object... args) {
Assert.hasText(scriptName, "ScriptName must not be null or empty!");
Assert.hasText(scriptName, "ScriptName must not be null or empty");
return mongoOperations.execute(new DbCallback<Object>() {
@ -122,7 +122,7 @@ class DefaultScriptOperations implements ScriptOperations { @@ -122,7 +122,7 @@ class DefaultScriptOperations implements ScriptOperations {
@Override
public boolean exists(String scriptName) {
Assert.hasText(scriptName, "ScriptName must not be null or empty!");
Assert.hasText(scriptName, "ScriptName must not be null or empty");
return mongoOperations.exists(query(where("_id").is(scriptName)), NamedMongoScript.class, SCRIPT_COLLECTION_NAME);
}

20
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EntityOperations.java

@ -112,7 +112,7 @@ class EntityOperations { @@ -112,7 +112,7 @@ class EntityOperations {
@SuppressWarnings({ "unchecked", "rawtypes" })
<T> Entity<T> forEntity(T entity) {
Assert.notNull(entity, "Bean must not be null!");
Assert.notNull(entity, "Bean must not be null");
if (entity instanceof String) {
return new UnmappedEntity(parse(entity.toString()));
@ -135,8 +135,8 @@ class EntityOperations { @@ -135,8 +135,8 @@ class EntityOperations {
@SuppressWarnings({ "unchecked", "rawtypes" })
<T> AdaptibleEntity<T> forEntity(T entity, ConversionService conversionService) {
Assert.notNull(entity, "Bean must not be null!");
Assert.notNull(conversionService, "ConversionService must not be null!");
Assert.notNull(entity, "Bean must not be null");
Assert.notNull(conversionService, "ConversionService must not be null");
if (entity instanceof String) {
return new UnmappedEntity(parse(entity.toString()));
@ -171,7 +171,7 @@ class EntityOperations { @@ -171,7 +171,7 @@ class EntityOperations {
if (entityClass == null) {
throw new InvalidDataAccessApiUsageException(
"No class parameter provided, entity collection can't be determined!");
"No class parameter provided, entity collection can't be determined");
}
return context.getRequiredPersistentEntity(entityClass).getCollection();
@ -201,7 +201,7 @@ class EntityOperations { @@ -201,7 +201,7 @@ class EntityOperations {
*/
public String getIdPropertyName(Class<?> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
MongoPersistentEntity<?> persistentEntity = context.getPersistentEntity(type);
@ -240,12 +240,12 @@ class EntityOperations { @@ -240,12 +240,12 @@ class EntityOperations {
try {
return Document.parse(source);
} catch (org.bson.json.JsonParseException o_O) {
throw new MappingException("Could not parse given String to save into a JSON document!", o_O);
throw new MappingException("Could not parse given String to save into a JSON document", o_O);
} catch (RuntimeException o_O) {
// legacy 3.x exception
if (ClassUtils.matchesTypeName(o_O.getClass(), "JSONParseException")) {
throw new MappingException("Could not parse given String to save into a JSON document!", o_O);
throw new MappingException("Could not parse given String to save into a JSON document", o_O);
}
throw o_O;
}
@ -518,7 +518,7 @@ class EntityOperations { @@ -518,7 +518,7 @@ class EntityOperations {
@Override
public Query getQueryForVersion() {
throw new MappingException("Cannot query for version on plain Documents!");
throw new MappingException("Cannot query for version on plain Documents");
}
@Override
@ -614,7 +614,7 @@ class EntityOperations { @@ -614,7 +614,7 @@ class EntityOperations {
public Query getByIdQuery() {
if (!entity.hasIdProperty()) {
throw new MappingException("No id property found for object of type " + entity.getType() + "!");
throw new MappingException("No id property found for object of type " + entity.getType());
}
MongoPersistentProperty idProperty = entity.getRequiredIdProperty();
@ -662,7 +662,7 @@ class EntityOperations { @@ -662,7 +662,7 @@ class EntityOperations {
if (!MongoSimpleTypes.AUTOGENERATED_ID_TYPES.contains(property.getType())) {
throw new InvalidDataAccessApiUsageException(
String.format("Cannot autogenerate id of type %s for entity of type %s!", property.getType().getName(),
String.format("Cannot autogenerate id of type %s for entity of type %s", property.getType().getName(),
entity.getType().getName()));
}
}

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableAggregationOperationSupport.java

@ -41,7 +41,7 @@ class ExecutableAggregationOperationSupport implements ExecutableAggregationOper @@ -41,7 +41,7 @@ class ExecutableAggregationOperationSupport implements ExecutableAggregationOper
@Override
public <T> ExecutableAggregation<T> aggregateAndReturn(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ExecutableAggregationSupport<>(template, domainType, null, null);
}
@ -69,7 +69,7 @@ class ExecutableAggregationOperationSupport implements ExecutableAggregationOper @@ -69,7 +69,7 @@ class ExecutableAggregationOperationSupport implements ExecutableAggregationOper
@Override
public AggregationWithAggregation<T> inCollection(String collection) {
Assert.hasText(collection, "Collection must not be null nor empty!");
Assert.hasText(collection, "Collection must not be null nor empty");
return new ExecutableAggregationSupport<>(template, domainType, aggregation, collection);
}
@ -77,7 +77,7 @@ class ExecutableAggregationOperationSupport implements ExecutableAggregationOper @@ -77,7 +77,7 @@ class ExecutableAggregationOperationSupport implements ExecutableAggregationOper
@Override
public TerminatingAggregation<T> by(Aggregation aggregation) {
Assert.notNull(aggregation, "Aggregation must not be null!");
Assert.notNull(aggregation, "Aggregation must not be null");
return new ExecutableAggregationSupport<>(template, domainType, aggregation, collection);
}

16
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableFindOperationSupport.java

@ -53,7 +53,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @@ -53,7 +53,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
@Override
public <T> ExecutableFind<T> query(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ExecutableFindSupport<>(template, domainType, domainType, null, ALL_QUERY);
}
@ -84,7 +84,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @@ -84,7 +84,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
@Override
public FindWithProjection<T> inCollection(String collection) {
Assert.hasText(collection, "Collection name must not be null nor empty!");
Assert.hasText(collection, "Collection name must not be null nor empty");
return new ExecutableFindSupport<>(template, domainType, returnType, collection, query);
}
@ -92,7 +92,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @@ -92,7 +92,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
@Override
public <T1> FindWithQuery<T1> as(Class<T1> returnType) {
Assert.notNull(returnType, "ReturnType must not be null!");
Assert.notNull(returnType, "ReturnType must not be null");
return new ExecutableFindSupport<>(template, domainType, returnType, collection, query);
}
@ -100,7 +100,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @@ -100,7 +100,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
@Override
public TerminatingFind<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new ExecutableFindSupport<>(template, domainType, returnType, collection, query);
}
@ -115,7 +115,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @@ -115,7 +115,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
}
if (result.size() > 1) {
throw new IncorrectResultSizeDataAccessException("Query " + asString() + " returned non unique result.", 1);
throw new IncorrectResultSizeDataAccessException("Query " + asString() + " returned non unique result", 1);
}
return result.iterator().next();
@ -158,7 +158,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @@ -158,7 +158,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
@Override
public TerminatingDistinct<Object> distinct(String field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
return new DistinctOperationSupport(this, field);
}
@ -246,7 +246,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @@ -246,7 +246,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
@SuppressWarnings("unchecked")
public <R> TerminatingDistinct<R> as(Class<R> resultType) {
Assert.notNull(resultType, "ResultType must not be null!");
Assert.notNull(resultType, "ResultType must not be null");
return new DistinctOperationSupport<>((ExecutableFindSupport) delegate.as(resultType), field);
}
@ -254,7 +254,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @@ -254,7 +254,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
@Override
public TerminatingDistinct<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new DistinctOperationSupport<>((ExecutableFindSupport<T>) delegate.matching(query), field);
}

12
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableInsertOperationSupport.java

@ -43,7 +43,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @@ -43,7 +43,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation {
@Override
public <T> ExecutableInsert<T> insert(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ExecutableInsertSupport<>(template, domainType, null, null);
}
@ -70,7 +70,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @@ -70,7 +70,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation {
@Override
public T one(T object) {
Assert.notNull(object, "Object must not be null!");
Assert.notNull(object, "Object must not be null");
return template.insert(object, getCollectionName());
}
@ -78,7 +78,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @@ -78,7 +78,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation {
@Override
public Collection<T> all(Collection<? extends T> objects) {
Assert.notNull(objects, "Objects must not be null!");
Assert.notNull(objects, "Objects must not be null");
return template.insert(objects, getCollectionName());
}
@ -86,7 +86,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @@ -86,7 +86,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation {
@Override
public BulkWriteResult bulk(Collection<? extends T> objects) {
Assert.notNull(objects, "Objects must not be null!");
Assert.notNull(objects, "Objects must not be null");
return template.bulkOps(bulkMode != null ? bulkMode : BulkMode.ORDERED, domainType, getCollectionName())
.insert(new ArrayList<>(objects)).execute();
@ -95,7 +95,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @@ -95,7 +95,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation {
@Override
public InsertWithBulkMode<T> inCollection(String collection) {
Assert.hasText(collection, "Collection must not be null nor empty.");
Assert.hasText(collection, "Collection must not be null nor empty");
return new ExecutableInsertSupport<>(template, domainType, collection, bulkMode);
}
@ -103,7 +103,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @@ -103,7 +103,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation {
@Override
public TerminatingBulkInsert<T> withBulkMode(BulkMode bulkMode) {
Assert.notNull(bulkMode, "BulkMode must not be null!");
Assert.notNull(bulkMode, "BulkMode must not be null");
return new ExecutableInsertSupport<>(template, domainType, collection, bulkMode);
}

16
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableMapReduceOperationSupport.java

@ -37,7 +37,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @@ -37,7 +37,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio
ExecutableMapReduceOperationSupport(MongoTemplate template) {
Assert.notNull(template, "Template must not be null!");
Assert.notNull(template, "Template must not be null");
this.template = template;
}
@ -48,7 +48,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @@ -48,7 +48,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio
@Override
public <T> ExecutableMapReduceSupport<T> mapReduce(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ExecutableMapReduceSupport<>(template, domainType, domainType, null, ALL_QUERY, null, null, null);
}
@ -101,7 +101,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @@ -101,7 +101,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio
@Override
public MapReduceWithProjection<T> inCollection(String collection) {
Assert.hasText(collection, "Collection name must not be null nor empty!");
Assert.hasText(collection, "Collection name must not be null nor empty");
return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);
@ -114,7 +114,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @@ -114,7 +114,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio
@Override
public TerminatingMapReduce<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);
@ -127,7 +127,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @@ -127,7 +127,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio
@Override
public <R> MapReduceWithQuery<R> as(Class<R> resultType) {
Assert.notNull(resultType, "ResultType must not be null!");
Assert.notNull(resultType, "ResultType must not be null");
return new ExecutableMapReduceSupport<>(template, domainType, resultType, collection, query, mapFunction,
reduceFunction, options);
@ -140,7 +140,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @@ -140,7 +140,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio
@Override
public ExecutableMapReduce<T> with(MapReduceOptions options) {
Assert.notNull(options, "Options must not be null! Please consider empty MapReduceOptions#options() instead.");
Assert.notNull(options, "Options must not be null Please consider empty MapReduceOptions#options() instead");
return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);
@ -153,7 +153,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @@ -153,7 +153,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio
@Override
public MapReduceWithReduceFunction<T> map(String mapFunction) {
Assert.hasText(mapFunction, "MapFunction name must not be null nor empty!");
Assert.hasText(mapFunction, "MapFunction name must not be null nor empty");
return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);
@ -166,7 +166,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @@ -166,7 +166,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio
@Override
public ExecutableMapReduce<T> reduce(String reduceFunction) {
Assert.hasText(reduceFunction, "ReduceFunction name must not be null nor empty!");
Assert.hasText(reduceFunction, "ReduceFunction name must not be null nor empty");
return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableRemoveOperationSupport.java

@ -44,7 +44,7 @@ class ExecutableRemoveOperationSupport implements ExecutableRemoveOperation { @@ -44,7 +44,7 @@ class ExecutableRemoveOperationSupport implements ExecutableRemoveOperation {
@Override
public <T> ExecutableRemove<T> remove(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ExecutableRemoveSupport<>(tempate, domainType, ALL_QUERY, null);
}
@ -70,7 +70,7 @@ class ExecutableRemoveOperationSupport implements ExecutableRemoveOperation { @@ -70,7 +70,7 @@ class ExecutableRemoveOperationSupport implements ExecutableRemoveOperation {
@Override
public RemoveWithQuery<T> inCollection(String collection) {
Assert.hasText(collection, "Collection must not be null nor empty!");
Assert.hasText(collection, "Collection must not be null nor empty");
return new ExecutableRemoveSupport<>(template, domainType, query, collection);
}
@ -78,7 +78,7 @@ class ExecutableRemoveOperationSupport implements ExecutableRemoveOperation { @@ -78,7 +78,7 @@ class ExecutableRemoveOperationSupport implements ExecutableRemoveOperation {
@Override
public TerminatingRemove<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new ExecutableRemoveSupport<>(template, domainType, query, collection);
}

16
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableUpdateOperationSupport.java

@ -43,7 +43,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @@ -43,7 +43,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
@Override
public <T> ExecutableUpdate<T> update(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ExecutableUpdateSupport<>(template, domainType, ALL_QUERY, null, null, null, null, null, domainType);
}
@ -84,7 +84,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @@ -84,7 +84,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
@Override
public TerminatingUpdate<T> apply(UpdateDefinition update) {
Assert.notNull(update, "Update must not be null!");
Assert.notNull(update, "Update must not be null");
return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, targetType);
@ -93,7 +93,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @@ -93,7 +93,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
@Override
public UpdateWithQuery<T> inCollection(String collection) {
Assert.hasText(collection, "Collection must not be null nor empty!");
Assert.hasText(collection, "Collection must not be null nor empty");
return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, targetType);
@ -102,7 +102,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @@ -102,7 +102,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
@Override
public TerminatingFindAndModify<T> withOptions(FindAndModifyOptions options) {
Assert.notNull(options, "Options must not be null!");
Assert.notNull(options, "Options must not be null");
return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, options,
findAndReplaceOptions, replacement, targetType);
@ -111,7 +111,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @@ -111,7 +111,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
@Override
public FindAndReplaceWithProjection<T> replaceWith(T replacement) {
Assert.notNull(replacement, "Replacement must not be null!");
Assert.notNull(replacement, "Replacement must not be null");
return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, targetType);
@ -120,7 +120,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @@ -120,7 +120,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
@Override
public FindAndReplaceWithProjection<T> withOptions(FindAndReplaceOptions options) {
Assert.notNull(options, "Options must not be null!");
Assert.notNull(options, "Options must not be null");
return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
options, replacement, targetType);
@ -129,7 +129,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @@ -129,7 +129,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
@Override
public UpdateWithUpdate<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, targetType);
@ -138,7 +138,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @@ -138,7 +138,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
@Override
public <R> FindAndReplaceWithOptions<R> as(Class<R> resultType) {
Assert.notNull(resultType, "ResultType must not be null!");
Assert.notNull(resultType, "ResultType must not be null");
return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, resultType);

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndModifyOptions.java

@ -35,7 +35,7 @@ public class FindAndModifyOptions { @@ -35,7 +35,7 @@ public class FindAndModifyOptions {
private static final FindAndModifyOptions NONE = new FindAndModifyOptions() {
private static final String ERROR_MSG = "FindAndModifyOptions.none() cannot be changed. Please use FindAndModifyOptions.options() instead.";
private static final String ERROR_MSG = "FindAndModifyOptions.none() cannot be changed; Please use FindAndModifyOptions.options() instead";
@Override
public FindAndModifyOptions returnNew(boolean returnNew) {

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndReplaceOptions.java

@ -38,7 +38,7 @@ public class FindAndReplaceOptions { @@ -38,7 +38,7 @@ public class FindAndReplaceOptions {
private static final FindAndReplaceOptions NONE = new FindAndReplaceOptions() {
private static final String ERROR_MSG = "FindAndReplaceOptions.none() cannot be changed. Please use FindAndReplaceOptions.options() instead.";
private static final String ERROR_MSG = "FindAndReplaceOptions.none() cannot be changed; Please use FindAndReplaceOptions.options() instead";
@Override
public FindAndReplaceOptions returnNew() {

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindPublisherPreparer.java

@ -61,8 +61,8 @@ public interface FindPublisherPreparer extends ReadPreferenceAware { @@ -61,8 +61,8 @@ public interface FindPublisherPreparer extends ReadPreferenceAware {
default FindPublisher<Document> initiateFind(MongoCollection<Document> collection,
Function<MongoCollection<Document>, FindPublisher<Document>> find) {
Assert.notNull(collection, "Collection must not be null!");
Assert.notNull(find, "Find function must not be null!");
Assert.notNull(collection, "Collection must not be null");
Assert.notNull(find, "Find function must not be null");
if (hasReadPreference()) {
collection = collection.withReadPreference(getReadPreference());

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/GeoCommandStatistics.java

@ -39,7 +39,7 @@ class GeoCommandStatistics { @@ -39,7 +39,7 @@ class GeoCommandStatistics {
*/
private GeoCommandStatistics(Document source) {
Assert.notNull(source, "Source document must not be null!");
Assert.notNull(source, "Source document must not be null");
this.source = source;
}
@ -51,7 +51,7 @@ class GeoCommandStatistics { @@ -51,7 +51,7 @@ class GeoCommandStatistics {
*/
public static GeoCommandStatistics from(Document commandResult) {
Assert.notNull(commandResult, "Command result must not be null!");
Assert.notNull(commandResult, "Command result must not be null");
Object stats = commandResult.get("stats");
return stats == null ? NONE : new GeoCommandStatistics((Document) stats);

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MappingMongoJsonSchemaCreator.java

@ -81,7 +81,7 @@ class MappingMongoJsonSchemaCreator implements MongoJsonSchemaCreator { @@ -81,7 +81,7 @@ class MappingMongoJsonSchemaCreator implements MongoJsonSchemaCreator {
MappingContext<MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext,
Predicate<JsonSchemaPropertyContext> filter, LinkedMultiValueMap<String, Class<?>> mergeProperties) {
Assert.notNull(converter, "Converter must not be null!");
Assert.notNull(converter, "Converter must not be null");
this.converter = converter;
this.mappingContext = mappingContext;
this.filter = filter;

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAction.java

@ -57,8 +57,8 @@ public class MongoAction { @@ -57,8 +57,8 @@ public class MongoAction {
public MongoAction(@Nullable WriteConcern defaultWriteConcern, MongoActionOperation mongoActionOperation,
String collectionName, @Nullable Class<?> entityType, @Nullable Document document, @Nullable Document query) {
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(mongoActionOperation, "MongoActionOperation must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty");
Assert.notNull(mongoActionOperation, "MongoActionOperation must not be null");
this.defaultWriteConcern = defaultWriteConcern;
this.mongoActionOperation = mongoActionOperation;

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAdmin.java

@ -42,7 +42,7 @@ public class MongoAdmin implements MongoAdminOperations { @@ -42,7 +42,7 @@ public class MongoAdmin implements MongoAdminOperations {
*/
public MongoAdmin(MongoClient client) {
Assert.notNull(client, "Client must not be null!");
Assert.notNull(client, "Client must not be null");
this.mongoClient = client;
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoClientFactoryBean.java

@ -146,7 +146,7 @@ public class MongoClientFactoryBean extends AbstractFactoryBean<MongoClient> imp @@ -146,7 +146,7 @@ public class MongoClientFactoryBean extends AbstractFactoryBean<MongoClient> imp
protected MongoClientSettings computeClientSetting() {
if (connectionString != null && (StringUtils.hasText(host) || port != null)) {
throw new IllegalStateException("ConnectionString and host/port configuration exclude one another!");
throw new IllegalStateException("ConnectionString and host/port configuration exclude one another");
}
ConnectionString connectionString = this.connectionString != null ? this.connectionString

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDataIntegrityViolationException.java

@ -44,8 +44,8 @@ public class MongoDataIntegrityViolationException extends DataIntegrityViolation @@ -44,8 +44,8 @@ public class MongoDataIntegrityViolationException extends DataIntegrityViolation
super(message);
Assert.notNull(writeResult, "WriteResult must not be null!");
Assert.notNull(actionOperation, "MongoActionOperation must not be null!");
Assert.notNull(writeResult, "WriteResult must not be null");
Assert.notNull(actionOperation, "MongoActionOperation must not be null");
this.writeResult = writeResult;
this.actionOperation = actionOperation;

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDatabaseFactorySupport.java

@ -64,10 +64,10 @@ public abstract class MongoDatabaseFactorySupport<C> implements MongoDatabaseFac @@ -64,10 +64,10 @@ public abstract class MongoDatabaseFactorySupport<C> implements MongoDatabaseFac
protected MongoDatabaseFactorySupport(C mongoClient, String databaseName, boolean mongoInstanceCreated,
PersistenceExceptionTranslator exceptionTranslator) {
Assert.notNull(mongoClient, "MongoClient must not be null!");
Assert.hasText(databaseName, "Database name must not be empty!");
Assert.notNull(mongoClient, "MongoClient must not be null");
Assert.hasText(databaseName, "Database name must not be empty");
Assert.isTrue(databaseName.matches("[^/\\\\.$\"\\s]+"),
"Database name must not contain slashes, dots, spaces, quotes, or dollar signs!");
"Database name must not contain slashes, dots, spaces, quotes, or dollar signs");
this.mongoClient = mongoClient;
this.databaseName = databaseName;
@ -91,7 +91,7 @@ public abstract class MongoDatabaseFactorySupport<C> implements MongoDatabaseFac @@ -91,7 +91,7 @@ public abstract class MongoDatabaseFactorySupport<C> implements MongoDatabaseFac
@Override
public MongoDatabase getMongoDatabase(String dbName) throws DataAccessException {
Assert.hasText(dbName, "Database name must not be empty!");
Assert.hasText(dbName, "Database name must not be empty");
MongoDatabase db = doGetMongoDatabase(dbName);

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoJsonSchemaCreator.java

@ -192,7 +192,7 @@ public interface MongoJsonSchemaCreator { @@ -192,7 +192,7 @@ public interface MongoJsonSchemaCreator {
*/
static MongoJsonSchemaCreator create(MongoConverter mongoConverter) {
Assert.notNull(mongoConverter, "MongoConverter must not be null!");
Assert.notNull(mongoConverter, "MongoConverter must not be null");
return new MappingMongoJsonSchemaCreator(mongoConverter);
}

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java

@ -178,7 +178,7 @@ public interface MongoOperations extends FluentMongoOperations { @@ -178,7 +178,7 @@ public interface MongoOperations extends FluentMongoOperations {
*/
default SessionScoped withSession(Supplier<ClientSession> sessionProvider) {
Assert.notNull(sessionProvider, "SessionProvider must not be null!");
Assert.notNull(sessionProvider, "SessionProvider must not be null");
return new SessionScoped() {
@ -985,7 +985,7 @@ public interface MongoOperations extends FluentMongoOperations { @@ -985,7 +985,7 @@ public interface MongoOperations extends FluentMongoOperations {
@Nullable
default <T> T findAndReplace(Query query, T replacement, FindAndReplaceOptions options, String collectionName) {
Assert.notNull(replacement, "Replacement must not be null!");
Assert.notNull(replacement, "Replacement must not be null");
return findAndReplace(query, replacement, options, (Class<T>) ClassUtils.getUserClass(replacement), collectionName);
}
@ -1174,7 +1174,7 @@ public interface MongoOperations extends FluentMongoOperations { @@ -1174,7 +1174,7 @@ public interface MongoOperations extends FluentMongoOperations {
*/
default long estimatedCount(Class<?> entityClass) {
Assert.notNull(entityClass, "Entity class must not be null!");
Assert.notNull(entityClass, "Entity class must not be null");
return estimatedCount(getCollectionName(entityClass));
}

222
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

@ -216,7 +216,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -216,7 +216,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
*/
public MongoTemplate(MongoDatabaseFactory mongoDbFactory, @Nullable MongoConverter mongoConverter) {
Assert.notNull(mongoDbFactory, "MongoDbFactory must not be null!");
Assert.notNull(mongoDbFactory, "MongoDbFactory must not be null");
this.mongoDbFactory = mongoDbFactory;
this.exceptionTranslator = mongoDbFactory.getExceptionTranslator();
@ -338,7 +338,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -338,7 +338,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
*/
public void setEntityCallbacks(EntityCallbacks entityCallbacks) {
Assert.notNull(entityCallbacks, "EntityCallbacks must not be null!");
Assert.notNull(entityCallbacks, "EntityCallbacks must not be null");
this.entityCallbacks = entityCallbacks;
}
@ -430,10 +430,10 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -430,10 +430,10 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("ConstantConditions")
protected <T> Stream<T> doStream(Query query, Class<?> entityType, String collectionName, Class<T> returnType) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(entityType, "Entity type must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(returnType, "ReturnType must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(entityType, "Entity type must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
Assert.notNull(returnType, "ReturnType must not be null");
return execute(collectionName, (CollectionCallback<Stream<T>>) collection -> {
@ -462,7 +462,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -462,7 +462,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("ConstantConditions")
public Document executeCommand(String jsonCommand) {
Assert.hasText(jsonCommand, "JsonCommand must not be null nor empty!");
Assert.hasText(jsonCommand, "JsonCommand must not be null nor empty");
return execute(db -> db.runCommand(Document.parse(jsonCommand), Document.class));
}
@ -471,7 +471,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -471,7 +471,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("ConstantConditions")
public Document executeCommand(Document command) {
Assert.notNull(command, "Command must not be null!");
Assert.notNull(command, "Command must not be null");
return execute(db -> db.runCommand(command, Document.class));
}
@ -480,7 +480,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -480,7 +480,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("ConstantConditions")
public Document executeCommand(Document command, @Nullable ReadPreference readPreference) {
Assert.notNull(command, "Command must not be null!");
Assert.notNull(command, "Command must not be null");
return execute(db -> readPreference != null //
? db.runCommand(command, readPreference, Document.class) //
@ -506,9 +506,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -506,9 +506,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
protected void executeQuery(Query query, String collectionName, DocumentCallbackHandler documentCallbackHandler,
@Nullable CursorPreparer preparer) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(documentCallbackHandler, "DocumentCallbackHandler must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(documentCallbackHandler, "DocumentCallbackHandler must not be null");
Document queryObject = queryMapper.getMappedObject(query.getQueryObject(), Optional.empty());
Document sortObject = query.getSortObject();
@ -526,7 +526,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -526,7 +526,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public <T> T execute(DbCallback<T> action) {
Assert.notNull(action, "DbCallback must not be null!");
Assert.notNull(action, "DbCallback must not be null");
try {
MongoDatabase db = prepareDatabase(this.doGetDatabase());
@ -539,15 +539,15 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -539,15 +539,15 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public <T> T execute(Class<?> entityClass, CollectionCallback<T> callback) {
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null");
return execute(getCollectionName(entityClass), callback);
}
@Override
public <T> T execute(String collectionName, CollectionCallback<T> callback) {
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(callback, "CollectionCallback must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(callback, "CollectionCallback must not be null");
try {
MongoCollection<Document> collection = getAndPrepareCollection(doGetDatabase(), collectionName);
@ -560,7 +560,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -560,7 +560,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public SessionScoped withSession(ClientSessionOptions options) {
Assert.notNull(options, "ClientSessionOptions must not be null!");
Assert.notNull(options, "ClientSessionOptions must not be null");
return withSession(() -> mongoDbFactory.getSession(options));
}
@ -568,7 +568,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -568,7 +568,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public MongoTemplate withSession(ClientSession session) {
Assert.notNull(session, "ClientSession must not be null!");
Assert.notNull(session, "ClientSession must not be null");
return new SessionBoundMongoTemplate(session, MongoTemplate.this);
}
@ -593,7 +593,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -593,7 +593,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public <T> MongoCollection<Document> createCollection(Class<T> entityClass,
@Nullable CollectionOptions collectionOptions) {
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null");
return doCreateCollection(getCollectionName(entityClass),
operations.convertToCreateCollectionOptions(collectionOptions, entityClass));
@ -602,7 +602,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -602,7 +602,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public MongoCollection<Document> createCollection(String collectionName) {
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null");
return doCreateCollection(collectionName, new Document());
}
@ -611,7 +611,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -611,7 +611,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public MongoCollection<Document> createCollection(String collectionName,
@Nullable CollectionOptions collectionOptions) {
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null");
return doCreateCollection(collectionName,
operations.convertToCreateCollectionOptions(collectionOptions, Object.class));
}
@ -620,7 +620,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -620,7 +620,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("ConstantConditions")
public MongoCollection<Document> getCollection(String collectionName) {
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null");
return execute(db -> db.getCollection(collectionName, Document.class));
}
@ -634,7 +634,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -634,7 +634,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("ConstantConditions")
public boolean collectionExists(String collectionName) {
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null");
return execute(db -> {
@ -655,7 +655,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -655,7 +655,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public void dropCollection(String collectionName) {
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null");
execute(collectionName, (CollectionCallback<Void>) collection -> {
collection.drop();
@ -695,8 +695,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -695,8 +695,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public BulkOperations bulkOps(BulkMode mode, @Nullable Class<?> entityType, String collectionName) {
Assert.notNull(mode, "BulkMode must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(mode, "BulkMode must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
DefaultBulkOperations operations = new DefaultBulkOperations(this, collectionName,
new BulkOperationContext(mode, Optional.ofNullable(getPersistentEntity(entityType)), queryMapper, updateMapper,
@ -724,9 +724,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -724,9 +724,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public <T> T findOne(Query query, Class<T> entityClass, String collectionName) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(entityClass, "EntityClass must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
if (ObjectUtils.isEmpty(query.getSortObject())) {
@ -756,7 +756,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -756,7 +756,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
if (query == null) {
throw new InvalidDataAccessApiUsageException("Query passed in to exist can't be null");
}
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null");
QueryContext queryContext = queryOperations.createQueryContext(query);
Document mappedQuery = queryContext.getMappedQuery(entityClass, this::getPersistentEntity);
@ -775,9 +775,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -775,9 +775,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public <T> List<T> find(Query query, Class<T> entityClass, String collectionName) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(entityClass, "EntityClass must not be null");
return doFind(collectionName, query.getQueryObject(), query.getFieldsObject(), entityClass,
new QueryCursorPreparer(query, entityClass));
@ -793,9 +793,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -793,9 +793,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public <T> T findById(Object id, Class<T> entityClass, String collectionName) {
Assert.notNull(id, "Id must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(id, "Id must not be null");
Assert.notNull(entityClass, "EntityClass must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
String idKey = operations.getIdPropertyName(entityClass);
@ -812,11 +812,11 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -812,11 +812,11 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public <T> List<T> findDistinct(Query query, String field, String collectionName, Class<?> entityClass,
Class<T> resultClass) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(field, "Field must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(resultClass, "ResultClass must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(field, "Field must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(entityClass, "EntityClass must not be null");
Assert.notNull(resultClass, "ResultClass must not be null");
MongoPersistentEntity<?> entity = entityClass != Object.class ? getPersistentEntity(entityClass) : null;
DistinctQueryContext distinctQueryContext = queryOperations.distinctQueryContext(query, field);
@ -872,15 +872,15 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -872,15 +872,15 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public <T> GeoResults<T> geoNear(NearQuery near, Class<?> domainType, String collectionName, Class<T> returnType) {
if (near == null) {
throw new InvalidDataAccessApiUsageException("NearQuery must not be null!");
throw new InvalidDataAccessApiUsageException("NearQuery must not be null");
}
if (domainType == null) {
throw new InvalidDataAccessApiUsageException("Entity class must not be null!");
throw new InvalidDataAccessApiUsageException("Entity class must not be null");
}
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(returnType, "ReturnType must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(returnType, "ReturnType must not be null");
String collection = StringUtils.hasText(collectionName) ? collectionName : getCollectionName(domainType);
String distanceField = operations.nearQueryDistanceFieldName(domainType);
@ -934,17 +934,17 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -934,17 +934,17 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public <T> T findAndModify(Query query, UpdateDefinition update, FindAndModifyOptions options, Class<T> entityClass,
String collectionName) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(update, "Update must not be null!");
Assert.notNull(options, "Options must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(update, "Update must not be null");
Assert.notNull(options, "Options must not be null");
Assert.notNull(entityClass, "EntityClass must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
FindAndModifyOptions optionsToUse = FindAndModifyOptions.of(options);
Optionals.ifAllPresent(query.getCollation(), optionsToUse.getCollation(), (l, r) -> {
throw new IllegalArgumentException(
"Both Query and FindAndModifyOptions define a collation. Please provide the collation only via one of the two.");
"Both Query and FindAndModifyOptions define a collation; Please provide the collation only via one of the two");
});
if (!options.getCollation().isPresent()) {
@ -959,15 +959,15 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -959,15 +959,15 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public <S, T> T findAndReplace(Query query, S replacement, FindAndReplaceOptions options, Class<S> entityType,
String collectionName, Class<T> resultType) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(replacement, "Replacement must not be null!");
Assert.notNull(options, "Options must not be null! Use FindAndReplaceOptions#empty() instead.");
Assert.notNull(entityType, "EntityType must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(resultType, "ResultType must not be null! Use Object.class instead.");
Assert.notNull(query, "Query must not be null");
Assert.notNull(replacement, "Replacement must not be null");
Assert.notNull(options, "Options must not be null Use FindAndReplaceOptions#empty() instead");
Assert.notNull(entityType, "EntityType must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(resultType, "ResultType must not be null Use Object.class instead");
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none!");
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip.");
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none");
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip");
MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityType);
QueryContext queryContext = queryOperations.createQueryContext(query);
@ -1007,9 +1007,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1007,9 +1007,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public <T> T findAndRemove(Query query, Class<T> entityClass, String collectionName) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(entityClass, "EntityClass must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
return doFindAndRemove(collectionName, query.getQueryObject(), query.getFieldsObject(),
getMappedSortObject(query, entityClass), operations.forType(entityClass).getCollation(query).orElse(null),
@ -1019,7 +1019,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1019,7 +1019,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public long count(Query query, Class<?> entityClass) {
Assert.notNull(entityClass, "Entity class must not be null!");
Assert.notNull(entityClass, "Entity class must not be null");
return count(query, entityClass, getCollectionName(entityClass));
}
@ -1035,8 +1035,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1035,8 +1035,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public long count(Query query, @Nullable Class<?> entityClass, String collectionName) {
Assert.notNull(query, "Query must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(query, "Query must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
CountContext countContext = queryOperations.countQueryContext(query);
@ -1103,7 +1103,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1103,7 +1103,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public <T> T insert(T objectToSave) {
Assert.notNull(objectToSave, "ObjectToSave must not be null!");
Assert.notNull(objectToSave, "ObjectToSave must not be null");
ensureNotCollectionLike(objectToSave);
return insert(objectToSave, getCollectionName(ClassUtils.getUserClass(objectToSave)));
@ -1113,8 +1113,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1113,8 +1113,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("unchecked")
public <T> T insert(T objectToSave, String collectionName) {
Assert.notNull(objectToSave, "ObjectToSave must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(objectToSave, "ObjectToSave must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
ensureNotCollectionLike(objectToSave);
return (T) doInsert(collectionName, objectToSave, this.mongoConverter);
@ -1130,7 +1130,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1130,7 +1130,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
protected void ensureNotCollectionLike(@Nullable Object source) {
if (EntityOperations.isCollectionLike(source)) {
throw new IllegalArgumentException("Cannot use a collection here.");
throw new IllegalArgumentException("Cannot use a collection here");
}
}
@ -1202,7 +1202,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1202,7 +1202,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("unchecked")
public <T> Collection<T> insert(Collection<? extends T> batchToSave, Class<?> entityClass) {
Assert.notNull(batchToSave, "BatchToSave must not be null!");
Assert.notNull(batchToSave, "BatchToSave must not be null");
return (Collection<T>) doInsertBatch(getCollectionName(entityClass), batchToSave, this.mongoConverter);
}
@ -1211,8 +1211,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1211,8 +1211,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("unchecked")
public <T> Collection<T> insert(Collection<? extends T> batchToSave, String collectionName) {
Assert.notNull(batchToSave, "BatchToSave must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(batchToSave, "BatchToSave must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
return (Collection<T>) doInsertBatch(collectionName, batchToSave, this.mongoConverter);
}
@ -1221,7 +1221,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1221,7 +1221,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("unchecked")
public <T> Collection<T> insertAll(Collection<? extends T> objectsToSave) {
Assert.notNull(objectsToSave, "ObjectsToSave must not be null!");
Assert.notNull(objectsToSave, "ObjectsToSave must not be null");
return (Collection<T>) doInsertAll(objectsToSave, this.mongoConverter);
}
@ -1258,7 +1258,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1258,7 +1258,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
protected <T> Collection<T> doInsertBatch(String collectionName, Collection<? extends T> batchToSave,
MongoWriter<T> writer) {
Assert.notNull(writer, "MongoWriter must not be null!");
Assert.notNull(writer, "MongoWriter must not be null");
List<Document> documentList = new ArrayList<>();
List<T> initializedBatchToSave = new ArrayList<>(batchToSave.size());
@ -1303,7 +1303,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1303,7 +1303,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public <T> T save(T objectToSave) {
Assert.notNull(objectToSave, "Object to save must not be null!");
Assert.notNull(objectToSave, "Object to save must not be null");
return save(objectToSave, getCollectionName(ClassUtils.getUserClass(objectToSave)));
}
@ -1311,8 +1311,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1311,8 +1311,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@SuppressWarnings("unchecked")
public <T> T save(T objectToSave, String collectionName) {
Assert.notNull(objectToSave, "Object to save must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(objectToSave, "Object to save must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
ensureNotCollectionLike(objectToSave);
AdaptibleEntity<T> source = operations.forEntity(objectToSave, mongoConverter.getConversionService());
@ -1355,7 +1355,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1355,7 +1355,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
if (result.getModifiedCount() == 0) {
throw new OptimisticLockingFailureException(
String.format("Cannot save entity %s with version %s to collection %s. Has it been modified meanwhile?",
String.format("Cannot save entity %s with version %s to collection %s; Has it been modified meanwhile",
source.getId(), source.getVersion(), collectionName));
}
maybeEmitEvent(new AfterSaveEvent<>(toSave, mapped.getDocument(), collectionName));
@ -1492,7 +1492,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1492,7 +1492,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public UpdateResult upsert(Query query, UpdateDefinition update, Class<?> entityClass, String collectionName) {
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null");
return doUpdate(collectionName, query, update, entityClass, true, false);
}
@ -1510,7 +1510,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1510,7 +1510,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public UpdateResult updateFirst(Query query, UpdateDefinition update, Class<?> entityClass, String collectionName) {
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null");
return doUpdate(collectionName, query, update, entityClass, false, false);
}
@ -1528,7 +1528,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1528,7 +1528,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public UpdateResult updateMulti(Query query, UpdateDefinition update, Class<?> entityClass, String collectionName) {
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null");
return doUpdate(collectionName, query, update, entityClass, false, true);
}
@ -1537,13 +1537,13 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1537,13 +1537,13 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
protected UpdateResult doUpdate(String collectionName, Query query, UpdateDefinition update,
@Nullable Class<?> entityClass, boolean upsert, boolean multi) {
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(query, "Query must not be null!");
Assert.notNull(update, "Update must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(query, "Query must not be null");
Assert.notNull(update, "Update must not be null");
if (query.isSorted() && LOGGER.isWarnEnabled()) {
LOGGER.warn(String.format("%s does not support sort ('%s'). Please use findAndModify() instead.",
LOGGER.warn(String.format("%s does not support sort ('%s'); Please use findAndModify() instead",
upsert ? "Upsert" : "UpdateFirst", serializeToJsonSafely(query.getSortObject())));
}
@ -1616,7 +1616,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1616,7 +1616,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public DeleteResult remove(Object object) {
Assert.notNull(object, "Object must not be null!");
Assert.notNull(object, "Object must not be null");
return remove(object, getCollectionName(object.getClass()));
}
@ -1624,8 +1624,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1624,8 +1624,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public DeleteResult remove(Object object, String collectionName) {
Assert.notNull(object, "Object must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(object, "Object must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
Query query = operations.forEntity(object).getRemoveByQuery();
@ -1645,7 +1645,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1645,7 +1645,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
@Override
public DeleteResult remove(Query query, Class<?> entityClass, String collectionName) {
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null");
return doRemove(collectionName, query, entityClass, true);
}
@ -1653,8 +1653,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1653,8 +1653,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
protected <T> DeleteResult doRemove(String collectionName, Query query, @Nullable Class<T> entityClass,
boolean multi) {
Assert.notNull(query, "Query must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(query, "Query must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
MongoPersistentEntity<?> entity = getPersistentEntity(entityClass);
@ -1764,11 +1764,11 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1764,11 +1764,11 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public <T> List<T> mapReduce(Query query, Class<?> domainType, String inputCollectionName, String mapFunction,
String reduceFunction, @Nullable MapReduceOptions mapReduceOptions, Class<T> resultType) {
Assert.notNull(domainType, "Domain type must not be null!");
Assert.notNull(inputCollectionName, "Input collection name must not be null!");
Assert.notNull(resultType, "Result type must not be null!");
Assert.notNull(mapFunction, "Map function must not be null!");
Assert.notNull(reduceFunction, "Reduce function must not be null!");
Assert.notNull(domainType, "Domain type must not be null");
Assert.notNull(inputCollectionName, "Input collection name must not be null");
Assert.notNull(resultType, "Result type must not be null");
Assert.notNull(mapFunction, "Map function must not be null");
Assert.notNull(reduceFunction, "Reduce function must not be null");
String mapFunc = replaceWithResourceIfNecessary(mapFunction);
String reduceFunc = replaceWithResourceIfNecessary(reduceFunction);
@ -1798,7 +1798,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1798,7 +1798,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
Optionals.ifAllPresent(collation, mapReduceOptions.getCollation(), (l, r) -> {
throw new IllegalArgumentException(
"Both Query and MapReduceOptions define a collation. Please provide the collation only via one of the two.");
"Both Query and MapReduceOptions define a collation; Please provide the collation only via one of the two.");
});
if (mapReduceOptions.getCollation().isPresent()) {
@ -1861,7 +1861,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1861,7 +1861,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public <O> AggregationResults<O> aggregate(TypedAggregation<?> aggregation, String inputCollectionName,
Class<O> outputType) {
Assert.notNull(aggregation, "Aggregation pipeline must not be null!");
Assert.notNull(aggregation, "Aggregation pipeline must not be null");
return aggregate(aggregation, inputCollectionName, outputType, null);
}
@ -1882,7 +1882,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1882,7 +1882,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public <O> Stream<O> aggregateStream(TypedAggregation<?> aggregation, String inputCollectionName,
Class<O> outputType) {
Assert.notNull(aggregation, "Aggregation pipeline must not be null!");
Assert.notNull(aggregation, "Aggregation pipeline must not be null");
AggregationOperationContext context = new TypeBasedAggregationOperationContext(aggregation.getInputType(),
mappingContext, queryMapper);
@ -1949,9 +1949,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1949,9 +1949,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
protected <O> AggregationResults<O> aggregate(Aggregation aggregation, String collectionName, Class<O> outputType,
@Nullable AggregationOperationContext context) {
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(aggregation, "Aggregation pipeline must not be null!");
Assert.notNull(outputType, "Output type must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty");
Assert.notNull(aggregation, "Aggregation pipeline must not be null");
Assert.notNull(outputType, "Output type must not be null");
return doAggregate(aggregation, collectionName, outputType,
queryOperations.createAggregation(aggregation, context));
@ -2043,10 +2043,10 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -2043,10 +2043,10 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
protected <O> Stream<O> aggregateStream(Aggregation aggregation, String collectionName, Class<O> outputType,
@Nullable AggregationOperationContext context) {
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(aggregation, "Aggregation pipeline must not be null!");
Assert.notNull(outputType, "Output type must not be null!");
Assert.isTrue(!aggregation.getOptions().isExplain(), "Can't use explain option with streaming!");
Assert.hasText(collectionName, "Collection name must not be null or empty");
Assert.notNull(aggregation, "Aggregation pipeline must not be null");
Assert.notNull(outputType, "Output type must not be null");
Assert.isTrue(!aggregation.getOptions().isExplain(), "Can't use explain option with streaming");
AggregationDefinition aggregationDefinition = queryOperations.createAggregation(aggregation, context);
@ -2123,7 +2123,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -2123,7 +2123,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
Resource functionResource = resourceLoader.getResource(func);
if (!functionResource.exists()) {
throw new InvalidDataAccessApiUsageException(String.format("Resource %s not found!", function));
throw new InvalidDataAccessApiUsageException(String.format("Resource %s not found", function));
}
Scanner scanner = null;
@ -2132,7 +2132,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -2132,7 +2132,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
scanner = new Scanner(functionResource.getInputStream());
return scanner.useDelimiter("\\A").next();
} catch (IOException e) {
throw new InvalidDataAccessApiUsageException(String.format("Cannot read map-reduce file %s!", function), e);
throw new InvalidDataAccessApiUsageException(String.format("Cannot read map-reduce file %s", function), e);
} finally {
if (scanner != null) {
scanner.close();
@ -2809,8 +2809,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -2809,8 +2809,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
public FindCallback(Document query, Document fields, @Nullable com.mongodb.client.model.Collation collation) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(fields, "Fields must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(fields, "Fields must not be null");
this.query = query;
this.fields = fields;
@ -3197,7 +3197,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -3197,7 +3197,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
*/
GeoNearResultDocumentCallback(String distanceField, DocumentCallback<T> delegate, Metric metric) {
Assert.notNull(delegate, "DocumentCallback must not be null!");
Assert.notNull(delegate, "DocumentCallback must not be null");
this.distanceField = distanceField;
this.delegate = delegate;

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveAggregationOperationSupport.java

@ -41,7 +41,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio @@ -41,7 +41,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio
*/
ReactiveAggregationOperationSupport(ReactiveMongoTemplate template) {
Assert.notNull(template, "Template must not be null!");
Assert.notNull(template, "Template must not be null");
this.template = template;
}
@ -49,7 +49,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio @@ -49,7 +49,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio
@Override
public <T> ReactiveAggregation<T> aggregateAndReturn(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ReactiveAggregationSupport<>(template, domainType, null, null);
}
@ -74,7 +74,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio @@ -74,7 +74,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio
@Override
public AggregationOperationWithAggregation<T> inCollection(String collection) {
Assert.hasText(collection, "Collection must not be null nor empty!");
Assert.hasText(collection, "Collection must not be null nor empty");
return new ReactiveAggregationSupport<>(template, domainType, aggregation, collection);
}
@ -82,7 +82,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio @@ -82,7 +82,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio
@Override
public TerminatingAggregationOperation<T> by(Aggregation aggregation) {
Assert.notNull(aggregation, "Aggregation must not be null!");
Assert.notNull(aggregation, "Aggregation must not be null");
return new ReactiveAggregationSupport<>(template, domainType, aggregation, collection);
}

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveChangeStreamOperationSupport.java

@ -49,7 +49,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat @@ -49,7 +49,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat
@Override
public <T> ReactiveChangeStream<T> changeStream(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ReactiveChangeStreamSupport<>(template, domainType, domainType, null, null);
}
@ -75,7 +75,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat @@ -75,7 +75,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat
@Override
public ChangeStreamWithFilterAndProjection<T> watchCollection(String collection) {
Assert.hasText(collection, "Collection name must not be null nor empty!");
Assert.hasText(collection, "Collection name must not be null nor empty");
return new ReactiveChangeStreamSupport<>(template, domainType, returnType, collection, options);
}
@ -83,7 +83,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat @@ -83,7 +83,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat
@Override
public ChangeStreamWithFilterAndProjection<T> watchCollection(Class<?> entityClass) {
Assert.notNull(entityClass, "Collection type not be null!");
Assert.notNull(entityClass, "Collection type not be null");
return watchCollection(template.getCollectionName(entityClass));
}
@ -129,7 +129,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat @@ -129,7 +129,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat
@Override
public <R> ChangeStreamWithFilterAndProjection<R> as(Class<R> resultType) {
Assert.notNull(resultType, "ResultType must not be null!");
Assert.notNull(resultType, "ResultType must not be null");
return new ReactiveChangeStreamSupport<>(template, domainType, resultType, collection, options);
}

16
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveFindOperationSupport.java

@ -47,7 +47,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @@ -47,7 +47,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation {
@Override
public <T> ReactiveFind<T> query(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ReactiveFindSupport<>(template, domainType, domainType, null, ALL_QUERY);
}
@ -80,7 +80,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @@ -80,7 +80,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation {
@Override
public FindWithProjection<T> inCollection(String collection) {
Assert.hasText(collection, "Collection name must not be null nor empty!");
Assert.hasText(collection, "Collection name must not be null nor empty");
return new ReactiveFindSupport<>(template, domainType, returnType, collection, query);
}
@ -88,7 +88,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @@ -88,7 +88,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation {
@Override
public <T1> FindWithQuery<T1> as(Class<T1> returnType) {
Assert.notNull(returnType, "ReturnType must not be null!");
Assert.notNull(returnType, "ReturnType must not be null");
return new ReactiveFindSupport<>(template, domainType, returnType, collection, query);
}
@ -96,7 +96,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @@ -96,7 +96,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation {
@Override
public TerminatingFind<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new ReactiveFindSupport<>(template, domainType, returnType, collection, query);
}
@ -124,7 +124,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @@ -124,7 +124,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation {
if (it.size() > 1) {
return Mono.error(
new IncorrectResultSizeDataAccessException("Query " + asString() + " returned non unique result.", 1));
new IncorrectResultSizeDataAccessException("Query " + asString() + " returned non unique result", 1));
}
return Mono.just(it.get(0));
@ -159,7 +159,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @@ -159,7 +159,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation {
@Override
public TerminatingDistinct<Object> distinct(String field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
return new DistinctOperationSupport<>(this, field);
}
@ -210,7 +210,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @@ -210,7 +210,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation {
@Override
public <R> TerminatingDistinct<R> as(Class<R> resultType) {
Assert.notNull(resultType, "ResultType must not be null!");
Assert.notNull(resultType, "ResultType must not be null");
return new DistinctOperationSupport<>((ReactiveFindSupport) delegate.as(resultType), field);
}
@ -219,7 +219,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @@ -219,7 +219,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation {
@SuppressWarnings("unchecked")
public TerminatingDistinct<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new DistinctOperationSupport<>((ReactiveFindSupport<T>) delegate.matching(query), field);
}

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveInsertOperationSupport.java

@ -41,7 +41,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation { @@ -41,7 +41,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation {
@Override
public <T> ReactiveInsert<T> insert(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ReactiveInsertSupport<>(template, domainType, null);
}
@ -62,7 +62,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation { @@ -62,7 +62,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation {
@Override
public Mono<T> one(T object) {
Assert.notNull(object, "Object must not be null!");
Assert.notNull(object, "Object must not be null");
return template.insert(object, getCollectionName());
}
@ -70,7 +70,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation { @@ -70,7 +70,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation {
@Override
public Flux<T> all(Collection<? extends T> objects) {
Assert.notNull(objects, "Objects must not be null!");
Assert.notNull(objects, "Objects must not be null");
return template.insert(objects, getCollectionName());
}
@ -78,7 +78,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation { @@ -78,7 +78,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation {
@Override
public ReactiveInsert<T> inCollection(String collection) {
Assert.hasText(collection, "Collection must not be null nor empty.");
Assert.hasText(collection, "Collection must not be null nor empty");
return new ReactiveInsertSupport<>(template, domainType, collection);
}

14
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMapReduceOperationSupport.java

@ -46,7 +46,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @@ -46,7 +46,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation {
@Override
public <T> ReactiveMapReduceSupport<T> mapReduce(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ReactiveMapReduceSupport<>(template, domainType, domainType, null, ALL_QUERY, null, null, null);
}
@ -100,7 +100,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @@ -100,7 +100,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation {
@Override
public MapReduceWithProjection<T> inCollection(String collection) {
Assert.hasText(collection, "Collection name must not be null nor empty!");
Assert.hasText(collection, "Collection name must not be null nor empty");
return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);
@ -113,7 +113,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @@ -113,7 +113,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation {
@Override
public TerminatingMapReduce<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);
@ -126,7 +126,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @@ -126,7 +126,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation {
@Override
public <R> MapReduceWithQuery<R> as(Class<R> resultType) {
Assert.notNull(resultType, "ResultType must not be null!");
Assert.notNull(resultType, "ResultType must not be null");
return new ReactiveMapReduceSupport<>(template, domainType, resultType, collection, query, mapFunction,
reduceFunction, options);
@ -139,7 +139,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @@ -139,7 +139,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation {
@Override
public ReactiveMapReduce<T> with(MapReduceOptions options) {
Assert.notNull(options, "Options must not be null! Please consider empty MapReduceOptions#options() instead.");
Assert.notNull(options, "Options must not be null Please consider empty MapReduceOptions#options() instead");
return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);
@ -152,7 +152,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @@ -152,7 +152,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation {
@Override
public MapReduceWithReduceFunction<T> map(String mapFunction) {
Assert.hasText(mapFunction, "MapFunction name must not be null nor empty!");
Assert.hasText(mapFunction, "MapFunction name must not be null nor empty");
return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);
@ -165,7 +165,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @@ -165,7 +165,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation {
@Override
public ReactiveMapReduce<T> reduce(String reduceFunction) {
Assert.hasText(reduceFunction, "ReduceFunction name must not be null nor empty!");
Assert.hasText(reduceFunction, "ReduceFunction name must not be null nor empty");
return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction,
reduceFunction, options);

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoClientFactoryBean.java

@ -115,7 +115,7 @@ public class ReactiveMongoClientFactoryBean extends AbstractFactoryBean<MongoCli @@ -115,7 +115,7 @@ public class ReactiveMongoClientFactoryBean extends AbstractFactoryBean<MongoCli
}
throw new IllegalStateException(
"Cannot create MongoClients. One of the following is required: mongoClientSettings, connectionString or host/port");
"Cannot create MongoClients; One of the following is required: mongoClientSettings, connectionString or host/port");
}
@Override

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoContext.java

@ -70,8 +70,8 @@ public class ReactiveMongoContext { @@ -70,8 +70,8 @@ public class ReactiveMongoContext {
*/
public static Context setSession(Context context, Publisher<ClientSession> session) {
Assert.notNull(context, "Context must not be null!");
Assert.notNull(session, "Session publisher must not be null!");
Assert.notNull(context, "Context must not be null");
Assert.notNull(session, "Session publisher must not be null");
return context.put(SESSION_KEY, Mono.from(session));
}

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java

@ -164,7 +164,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { @@ -164,7 +164,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
*/
default ReactiveSessionScoped withSession(Supplier<ClientSession> sessionProvider) {
Assert.notNull(sessionProvider, "SessionProvider must not be null!");
Assert.notNull(sessionProvider, "SessionProvider must not be null");
return withSession(Mono.fromSupplier(sessionProvider));
}
@ -756,7 +756,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { @@ -756,7 +756,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
*/
default <T> Mono<T> findAndReplace(Query query, T replacement, FindAndReplaceOptions options, String collectionName) {
Assert.notNull(replacement, "Replacement must not be null!");
Assert.notNull(replacement, "Replacement must not be null");
return findAndReplace(query, replacement, options, (Class<T>) ClassUtils.getUserClass(replacement), collectionName);
}
@ -941,7 +941,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { @@ -941,7 +941,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
*/
default Mono<Long> estimatedCount(Class<?> entityClass) {
Assert.notNull(entityClass, "Entity class must not be null!");
Assert.notNull(entityClass, "Entity class must not be null");
return estimatedCount(getCollectionName(entityClass));
}

138
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java

@ -241,7 +241,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -241,7 +241,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
public ReactiveMongoTemplate(ReactiveMongoDatabaseFactory mongoDatabaseFactory,
@Nullable MongoConverter mongoConverter, Consumer<Throwable> subscriptionExceptionHandler) {
Assert.notNull(mongoDatabaseFactory, "ReactiveMongoDatabaseFactory must not be null!");
Assert.notNull(mongoDatabaseFactory, "ReactiveMongoDatabaseFactory must not be null");
this.mongoDatabaseFactory = mongoDatabaseFactory;
this.exceptionTranslator = mongoDatabaseFactory.getExceptionTranslator();
@ -367,7 +367,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -367,7 +367,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
*/
public void setEntityCallbacks(ReactiveEntityCallbacks entityCallbacks) {
Assert.notNull(entityCallbacks, "EntityCallbacks must not be null!");
Assert.notNull(entityCallbacks, "EntityCallbacks must not be null");
this.entityCallbacks = entityCallbacks;
}
@ -468,7 +468,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -468,7 +468,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public Mono<Document> executeCommand(String jsonCommand) {
Assert.notNull(jsonCommand, "Command must not be empty!");
Assert.notNull(jsonCommand, "Command must not be empty");
return executeCommand(Document.parse(jsonCommand));
}
@ -481,7 +481,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -481,7 +481,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public Mono<Document> executeCommand(Document command, @Nullable ReadPreference readPreference) {
Assert.notNull(command, "Command must not be null!");
Assert.notNull(command, "Command must not be null");
return createFlux(db -> readPreference != null ? db.runCommand(command, readPreference, Document.class)
: db.runCommand(command, Document.class)).next();
@ -500,7 +500,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -500,7 +500,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public <T> Flux<T> execute(String collectionName, ReactiveCollectionCallback<T> callback) {
Assert.notNull(callback, "ReactiveCollectionCallback must not be null!");
Assert.notNull(callback, "ReactiveCollectionCallback must not be null");
return createFlux(collectionName, callback);
}
@ -565,7 +565,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -565,7 +565,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
*/
public <T> Flux<T> createFlux(ReactiveDatabaseCallback<T> callback) {
Assert.notNull(callback, "ReactiveDatabaseCallback must not be null!");
Assert.notNull(callback, "ReactiveDatabaseCallback must not be null");
return Mono.defer(this::doGetDatabase).flatMapMany(database -> callback.doInDB(prepareDatabase(database)))
.onErrorMap(translateException());
@ -580,7 +580,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -580,7 +580,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
*/
public <T> Mono<T> createMono(ReactiveDatabaseCallback<T> callback) {
Assert.notNull(callback, "ReactiveDatabaseCallback must not be null!");
Assert.notNull(callback, "ReactiveDatabaseCallback must not be null");
return Mono.defer(this::doGetDatabase).flatMap(database -> Mono.from(callback.doInDB(prepareDatabase(database))))
.onErrorMap(translateException());
@ -595,8 +595,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -595,8 +595,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
*/
public <T> Flux<T> createFlux(String collectionName, ReactiveCollectionCallback<T> callback) {
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(callback, "ReactiveDatabaseCallback must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty");
Assert.notNull(callback, "ReactiveDatabaseCallback must not be null");
Mono<MongoCollection<Document>> collectionPublisher = doGetDatabase()
.map(database -> getAndPrepareCollection(database, collectionName));
@ -614,8 +614,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -614,8 +614,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
*/
public <T> Mono<T> createMono(String collectionName, ReactiveCollectionCallback<T> callback) {
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(callback, "ReactiveCollectionCallback must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty");
Assert.notNull(callback, "ReactiveCollectionCallback must not be null");
Mono<MongoCollection<Document>> collectionPublisher = doGetDatabase()
.map(database -> getAndPrepareCollection(database, collectionName));
@ -633,7 +633,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -633,7 +633,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
public <T> Mono<MongoCollection<Document>> createCollection(Class<T> entityClass,
@Nullable CollectionOptions collectionOptions) {
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null");
CollectionOptions options = collectionOptions != null ? collectionOptions : CollectionOptions.empty();
options = Optionals
@ -658,7 +658,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -658,7 +658,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public Mono<MongoCollection<Document>> getCollection(String collectionName) {
Assert.notNull(collectionName, "Collection name must not be null!");
Assert.notNull(collectionName, "Collection name must not be null");
return createMono(db -> Mono.just(db.getCollection(collectionName)));
}
@ -795,11 +795,11 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -795,11 +795,11 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
public <T> Flux<T> findDistinct(Query query, String field, String collectionName, Class<?> entityClass,
Class<T> resultClass) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(field, "Field must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(entityClass, "EntityClass must not be null!");
Assert.notNull(resultClass, "ResultClass must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(field, "Field must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(entityClass, "EntityClass must not be null");
Assert.notNull(resultClass, "ResultClass must not be null");
MongoPersistentEntity<?> entity = getPersistentEntity(entityClass);
DistinctQueryContext distinctQueryContext = queryOperations.distinctQueryContext(query, field);
@ -839,7 +839,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -839,7 +839,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public <O> Flux<O> aggregate(TypedAggregation<?> aggregation, String inputCollectionName, Class<O> outputType) {
Assert.notNull(aggregation, "Aggregation pipeline must not be null!");
Assert.notNull(aggregation, "Aggregation pipeline must not be null");
return doAggregate(aggregation, inputCollectionName, aggregation.getInputType(), outputType);
}
@ -862,12 +862,12 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -862,12 +862,12 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
protected <O> Flux<O> doAggregate(Aggregation aggregation, String collectionName, @Nullable Class<?> inputType,
Class<O> outputType) {
Assert.notNull(aggregation, "Aggregation pipeline must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(outputType, "Output type must not be null!");
Assert.notNull(aggregation, "Aggregation pipeline must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
Assert.notNull(outputType, "Output type must not be null");
AggregationOptions options = aggregation.getOptions();
Assert.isTrue(!options.isExplain(), "Cannot use explain option with streaming!");
Assert.isTrue(!options.isExplain(), "Cannot use explain option with streaming");
AggregationDefinition ctx = queryOperations.createAggregation(aggregation, inputType);
@ -925,11 +925,11 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -925,11 +925,11 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
Class<T> returnType) {
if (near == null) {
throw new InvalidDataAccessApiUsageException("NearQuery must not be null!");
throw new InvalidDataAccessApiUsageException("NearQuery must not be null");
}
if (entityClass == null) {
throw new InvalidDataAccessApiUsageException("Entity class must not be null!");
throw new InvalidDataAccessApiUsageException("Entity class must not be null");
}
String collection = StringUtils.hasText(collectionName) ? collectionName : getCollectionName(entityClass);
@ -966,14 +966,14 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -966,14 +966,14 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
public <T> Mono<T> findAndModify(Query query, UpdateDefinition update, FindAndModifyOptions options,
Class<T> entityClass, String collectionName) {
Assert.notNull(options, "Options must not be null! ");
Assert.notNull(entityClass, "Entity class must not be null!");
Assert.notNull(options, "Options must not be null ");
Assert.notNull(entityClass, "Entity class must not be null");
FindAndModifyOptions optionsToUse = FindAndModifyOptions.of(options);
Optionals.ifAllPresent(query.getCollation(), optionsToUse.getCollation(), (l, r) -> {
throw new IllegalArgumentException(
"Both Query and FindAndModifyOptions define a collation. Please provide the collation only via one of the two.");
"Both Query and FindAndModifyOptions define a collation; Please provide the collation only via one of the two");
});
if (!optionsToUse.getCollation().isPresent()) {
@ -988,15 +988,15 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -988,15 +988,15 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
public <S, T> Mono<T> findAndReplace(Query query, S replacement, FindAndReplaceOptions options, Class<S> entityType,
String collectionName, Class<T> resultType) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(replacement, "Replacement must not be null!");
Assert.notNull(options, "Options must not be null! Use FindAndReplaceOptions#empty() instead.");
Assert.notNull(entityType, "Entity class must not be null!");
Assert.notNull(collectionName, "CollectionName must not be null!");
Assert.notNull(resultType, "ResultType must not be null! Use Object.class instead.");
Assert.notNull(query, "Query must not be null");
Assert.notNull(replacement, "Replacement must not be null");
Assert.notNull(options, "Options must not be null Use FindAndReplaceOptions#empty() instead");
Assert.notNull(entityType, "Entity class must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(resultType, "ResultType must not be null Use Object.class instead");
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none!");
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip.");
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none");
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip");
MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityType);
QueryContext queryContext = queryOperations.createQueryContext(query);
@ -1053,7 +1053,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1053,7 +1053,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public Mono<Long> count(Query query, Class<?> entityClass) {
Assert.notNull(entityClass, "Entity class must not be null!");
Assert.notNull(entityClass, "Entity class must not be null");
return count(query, entityClass, getCollectionName(entityClass));
}
@ -1066,8 +1066,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1066,8 +1066,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public Mono<Long> count(Query query, @Nullable Class<?> entityClass, String collectionName) {
Assert.notNull(query, "Query must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(query, "Query must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
return createMono(collectionName, collection -> {
@ -1152,7 +1152,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1152,7 +1152,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public <T> Mono<T> insert(Mono<? extends T> objectToSave) {
Assert.notNull(objectToSave, "Mono to insert must not be null!");
Assert.notNull(objectToSave, "Mono to insert must not be null");
return objectToSave.flatMap(this::insert);
}
@ -1165,7 +1165,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1165,7 +1165,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public <T> Flux<T> insertAll(Mono<? extends Collection<? extends T>> batchToSave, String collectionName) {
Assert.notNull(batchToSave, "Batch to insert must not be null!");
Assert.notNull(batchToSave, "Batch to insert must not be null");
return Flux.from(batchToSave).flatMap(collection -> insert(collection, collectionName));
}
@ -1173,7 +1173,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1173,7 +1173,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public <T> Mono<T> insert(T objectToSave) {
Assert.notNull(objectToSave, "Object to insert must not be null!");
Assert.notNull(objectToSave, "Object to insert must not be null");
ensureNotCollectionLike(objectToSave);
return insert(objectToSave, getCollectionName(ClassUtils.getUserClass(objectToSave)));
@ -1182,7 +1182,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1182,7 +1182,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public <T> Mono<T> insert(T objectToSave, String collectionName) {
Assert.notNull(objectToSave, "Object to insert must not be null!");
Assert.notNull(objectToSave, "Object to insert must not be null");
ensureNotCollectionLike(objectToSave);
return doInsert(collectionName, objectToSave, this.mongoConverter);
@ -1257,7 +1257,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1257,7 +1257,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
protected <T> Flux<T> doInsertBatch(String collectionName, Collection<? extends T> batchToSave,
MongoWriter<Object> writer) {
Assert.notNull(writer, "MongoWriter must not be null!");
Assert.notNull(writer, "MongoWriter must not be null");
Mono<List<Tuple2<AdaptibleEntity<T>, Document>>> prepareDocuments = Flux.fromIterable(batchToSave)
.flatMap(uninitialized -> {
@ -1300,7 +1300,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1300,7 +1300,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public <T> Mono<T> save(Mono<? extends T> objectToSave) {
Assert.notNull(objectToSave, "Mono to save must not be null!");
Assert.notNull(objectToSave, "Mono to save must not be null");
return objectToSave.flatMap(this::save);
}
@ -1308,7 +1308,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1308,7 +1308,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public <T> Mono<T> save(Mono<? extends T> objectToSave, String collectionName) {
Assert.notNull(objectToSave, "Mono to save must not be null!");
Assert.notNull(objectToSave, "Mono to save must not be null");
return objectToSave.flatMap(o -> save(o, collectionName));
}
@ -1316,15 +1316,15 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1316,15 +1316,15 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public <T> Mono<T> save(T objectToSave) {
Assert.notNull(objectToSave, "Object to save must not be null!");
Assert.notNull(objectToSave, "Object to save must not be null");
return save(objectToSave, getCollectionName(ClassUtils.getUserClass(objectToSave)));
}
@Override
public <T> Mono<T> save(T objectToSave, String collectionName) {
Assert.notNull(objectToSave, "Object to save must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(objectToSave, "Object to save must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
AdaptibleEntity<T> source = operations.forEntity(objectToSave, mongoConverter.getConversionService());
@ -1568,7 +1568,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1568,7 +1568,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
if (query.isSorted() && LOGGER.isWarnEnabled()) {
LOGGER.warn(String.format("%s does not support sort ('%s'). Please use findAndModify() instead.",
LOGGER.warn(String.format("%s does not support sort ('%s'); Please use findAndModify() instead",
upsert ? "Upsert" : "UpdateFirst", serializeToJsonSafely(query.getSortObject())));
}
@ -1682,7 +1682,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1682,7 +1682,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public Mono<DeleteResult> remove(Object object) {
Assert.notNull(object, "Object must not be null!");
Assert.notNull(object, "Object must not be null");
return remove(operations.forEntity(object).getRemoveByQuery(), object.getClass());
}
@ -1690,8 +1690,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1690,8 +1690,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
public Mono<DeleteResult> remove(Object object, String collectionName) {
Assert.notNull(object, "Object must not be null!");
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.notNull(object, "Object must not be null");
Assert.hasText(collectionName, "Collection name must not be null or empty");
return doRemove(collectionName, operations.forEntity(object).getRemoveByQuery(), object.getClass());
}
@ -1711,7 +1711,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1711,7 +1711,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
if (!MongoSimpleTypes.AUTOGENERATED_ID_TYPES.contains(property.getType())) {
throw new InvalidDataAccessApiUsageException(
String.format("Cannot autogenerate id of type %s for entity of type %s!", property.getType().getName(),
String.format("Cannot autogenerate id of type %s for entity of type %s", property.getType().getName(),
value.getClass().getName()));
}
}
@ -1735,10 +1735,10 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1735,10 +1735,10 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
protected <T> Mono<DeleteResult> doRemove(String collectionName, Query query, @Nullable Class<T> entityClass) {
if (query == null) {
throw new InvalidDataAccessApiUsageException("Query passed in to remove can't be null!");
throw new InvalidDataAccessApiUsageException("Query passed in to remove can't be null");
}
Assert.hasText(collectionName, "Collection name must not be null or empty!");
Assert.hasText(collectionName, "Collection name must not be null or empty");
MongoPersistentEntity<?> entity = getPersistentEntity(entityClass);
@ -1895,13 +1895,13 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1895,13 +1895,13 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
public <T> Flux<T> mapReduce(Query filterQuery, Class<?> domainType, String inputCollectionName, Class<T> resultType,
String mapFunction, String reduceFunction, MapReduceOptions options) {
Assert.notNull(filterQuery, "Filter query must not be null!");
Assert.notNull(domainType, "Domain type must not be null!");
Assert.hasText(inputCollectionName, "Input collection name must not be null or empty!");
Assert.notNull(resultType, "Result type must not be null!");
Assert.notNull(mapFunction, "Map function must not be null!");
Assert.notNull(reduceFunction, "Reduce function must not be null!");
Assert.notNull(options, "MapReduceOptions must not be null!");
Assert.notNull(filterQuery, "Filter query must not be null");
Assert.notNull(domainType, "Domain type must not be null");
Assert.hasText(inputCollectionName, "Input collection name must not be null or empty");
Assert.notNull(resultType, "Result type must not be null");
Assert.notNull(mapFunction, "Map function must not be null");
Assert.notNull(reduceFunction, "Reduce function must not be null");
Assert.notNull(options, "MapReduceOptions must not be null");
assertLocalFunctionNames(mapFunction, reduceFunction);
@ -1927,7 +1927,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1927,7 +1927,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
if (filterQuery.getLimit() > 0 && (options.getLimit() != null)) {
throw new IllegalArgumentException(
"Both Query and MapReduceOptions define a limit. Please provide the limit only via one of the two.");
"Both Query and MapReduceOptions define a limit; Please provide the limit only via one of the two.");
}
if (filterQuery.getLimit() > 0) {
@ -1943,7 +1943,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1943,7 +1943,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
Optionals.ifAllPresent(filterQuery.getCollation(), options.getCollation(), (l, r) -> {
throw new IllegalArgumentException(
"Both Query and MapReduceOptions define a collation. Please provide the collation only via one of the two.");
"Both Query and MapReduceOptions define a collation; Please provide the collation only via one of the two.");
});
if (options.getCollation().isPresent()) {
@ -1992,7 +1992,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -1992,7 +1992,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
if (ResourceUtils.isUrl(function)) {
throw new IllegalArgumentException(String.format(
"Blocking accessing to resource %s is not allowed using reactive infrastructure. You may load the resource at startup and cache its value.",
"Blocking accessing to resource %s is not allowed using reactive infrastructure; You may load the resource at startup and cache its value.",
function));
}
}
@ -2850,8 +2850,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -2850,8 +2850,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
ReadDocumentCallback(EntityReader<? super T, Bson> reader, Class<T> type, String collectionName) {
Assert.notNull(reader, "EntityReader must not be null!");
Assert.notNull(type, "Entity type must not be null!");
Assert.notNull(reader, "EntityReader must not be null");
Assert.notNull(type, "Entity type must not be null");
this.reader = reader;
this.type = type;
@ -2939,7 +2939,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @@ -2939,7 +2939,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
*/
GeoNearResultDocumentCallback(String distanceField, DocumentCallback<T> delegate, Metric metric) {
Assert.notNull(delegate, "DocumentCallback must not be null!");
Assert.notNull(delegate, "DocumentCallback must not be null");
this.distanceField = distanceField;
this.delegate = delegate;

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveRemoveOperationSupport.java

@ -44,7 +44,7 @@ class ReactiveRemoveOperationSupport implements ReactiveRemoveOperation { @@ -44,7 +44,7 @@ class ReactiveRemoveOperationSupport implements ReactiveRemoveOperation {
@Override
public <T> ReactiveRemove<T> remove(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ReactiveRemoveSupport<>(tempate, domainType, ALL_QUERY, null);
}
@ -67,7 +67,7 @@ class ReactiveRemoveOperationSupport implements ReactiveRemoveOperation { @@ -67,7 +67,7 @@ class ReactiveRemoveOperationSupport implements ReactiveRemoveOperation {
@Override
public RemoveWithQuery<T> inCollection(String collection) {
Assert.hasText(collection, "Collection must not be null nor empty!");
Assert.hasText(collection, "Collection must not be null nor empty");
return new ReactiveRemoveSupport<>(template, domainType, query, collection);
}
@ -75,7 +75,7 @@ class ReactiveRemoveOperationSupport implements ReactiveRemoveOperation { @@ -75,7 +75,7 @@ class ReactiveRemoveOperationSupport implements ReactiveRemoveOperation {
@Override
public TerminatingRemove<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new ReactiveRemoveSupport<>(template, domainType, query, collection);
}

16
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveUpdateOperationSupport.java

@ -45,7 +45,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @@ -45,7 +45,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation {
@Override
public <T> ReactiveUpdate<T> update(Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
Assert.notNull(domainType, "DomainType must not be null");
return new ReactiveUpdateSupport<>(template, domainType, ALL_QUERY, null, null, null, null, null, domainType);
}
@ -82,7 +82,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @@ -82,7 +82,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation {
@Override
public TerminatingUpdate<T> apply(org.springframework.data.mongodb.core.query.UpdateDefinition update) {
Assert.notNull(update, "Update must not be null!");
Assert.notNull(update, "Update must not be null");
return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, targetType);
@ -91,7 +91,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @@ -91,7 +91,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation {
@Override
public UpdateWithQuery<T> inCollection(String collection) {
Assert.hasText(collection, "Collection must not be null nor empty!");
Assert.hasText(collection, "Collection must not be null nor empty");
return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, targetType);
@ -127,7 +127,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @@ -127,7 +127,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation {
@Override
public UpdateWithUpdate<T> matching(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, targetType);
@ -141,7 +141,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @@ -141,7 +141,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation {
@Override
public TerminatingFindAndModify<T> withOptions(FindAndModifyOptions options) {
Assert.notNull(options, "Options must not be null!");
Assert.notNull(options, "Options must not be null");
return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, options,
findAndReplaceOptions, replacement, targetType);
@ -150,7 +150,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @@ -150,7 +150,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation {
@Override
public FindAndReplaceWithProjection<T> replaceWith(T replacement) {
Assert.notNull(replacement, "Replacement must not be null!");
Assert.notNull(replacement, "Replacement must not be null");
return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, targetType);
@ -159,7 +159,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @@ -159,7 +159,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation {
@Override
public FindAndReplaceWithProjection<T> withOptions(FindAndReplaceOptions options) {
Assert.notNull(options, "Options must not be null!");
Assert.notNull(options, "Options must not be null");
return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, options,
replacement, targetType);
@ -168,7 +168,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @@ -168,7 +168,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation {
@Override
public <R> FindAndReplaceWithOptions<R> as(Class<R> resultType) {
Assert.notNull(resultType, "ResultType must not be null!");
Assert.notNull(resultType, "ResultType must not be null");
return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions,
findAndReplaceOptions, replacement, resultType);

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/SimpleReactiveMongoDatabaseFactory.java

@ -77,10 +77,10 @@ public class SimpleReactiveMongoDatabaseFactory implements DisposableBean, React @@ -77,10 +77,10 @@ public class SimpleReactiveMongoDatabaseFactory implements DisposableBean, React
private SimpleReactiveMongoDatabaseFactory(MongoClient client, String databaseName, boolean mongoInstanceCreated) {
Assert.notNull(client, "MongoClient must not be null!");
Assert.hasText(databaseName, "Database name must not be empty!");
Assert.notNull(client, "MongoClient must not be null");
Assert.hasText(databaseName, "Database name must not be empty");
Assert.isTrue(databaseName.matches("[^/\\\\.$\"\\s]+"),
"Database name must not contain slashes, dots, spaces, quotes, or dollar signs!");
"Database name must not contain slashes, dots, spaces, quotes, or dollar signs");
this.mongo = client;
this.databaseName = databaseName;
@ -103,7 +103,7 @@ public class SimpleReactiveMongoDatabaseFactory implements DisposableBean, React @@ -103,7 +103,7 @@ public class SimpleReactiveMongoDatabaseFactory implements DisposableBean, React
public Mono<MongoDatabase> getMongoDatabase(String dbName) throws DataAccessException {
Assert.hasText(dbName, "Database name must not be empty.");
Assert.hasText(dbName, "Database name must not be empty");
return Mono.fromSupplier(() -> {

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AbstractAggregationExpression.java

@ -133,7 +133,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @@ -133,7 +133,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression {
@SuppressWarnings({ "unchecked", "rawtypes" })
protected Map<String, Object> append(String key, Object value) {
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!");
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map");
Map<String, Object> clone = new LinkedHashMap<>((java.util.Map) this.value);
clone.put(key, value);
@ -144,7 +144,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @@ -144,7 +144,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression {
@SuppressWarnings({ "unchecked", "rawtypes" })
protected Map<String, Object> remove(String key) {
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!");
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map");
Map<String, Object> clone = new LinkedHashMap<>((java.util.Map) this.value);
clone.remove(key);
@ -163,7 +163,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @@ -163,7 +163,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression {
@SuppressWarnings({ "unchecked" })
protected Map<String, Object> appendAt(int index, String key, Object value) {
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!");
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map");
Map<String, Object> clone = new LinkedHashMap<>();
@ -223,7 +223,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @@ -223,7 +223,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression {
@SuppressWarnings("unchecked")
protected <T> T get(Object key) {
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!");
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map");
return (T) ((Map<String, Object>) this.value).get(key);
}
@ -237,7 +237,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @@ -237,7 +237,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression {
@SuppressWarnings("unchecked")
protected Map<String, Object> argumentMap() {
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!");
Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map");
return Collections.unmodifiableMap((java.util.Map<String, Object>) value);
}

58
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AccumulatorOperators.java

@ -65,7 +65,7 @@ public class AccumulatorOperators { @@ -65,7 +65,7 @@ public class AccumulatorOperators {
*/
public AccumulatorOperatorFactory(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
this.fieldReference = fieldReference;
this.expression = null;
}
@ -77,7 +77,7 @@ public class AccumulatorOperators { @@ -77,7 +77,7 @@ public class AccumulatorOperators {
*/
public AccumulatorOperatorFactory(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
this.fieldReference = null;
this.expression = expression;
}
@ -278,7 +278,7 @@ public class AccumulatorOperators { @@ -278,7 +278,7 @@ public class AccumulatorOperators {
*/
public static Sum sumOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Sum(asFields(fieldReference));
}
@ -290,7 +290,7 @@ public class AccumulatorOperators { @@ -290,7 +290,7 @@ public class AccumulatorOperators {
*/
public static Sum sumOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Sum(Collections.singletonList(expression));
}
@ -303,7 +303,7 @@ public class AccumulatorOperators { @@ -303,7 +303,7 @@ public class AccumulatorOperators {
*/
public Sum and(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Sum(append(Fields.field(fieldReference)));
}
@ -316,7 +316,7 @@ public class AccumulatorOperators { @@ -316,7 +316,7 @@ public class AccumulatorOperators {
*/
public Sum and(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Sum(append(expression));
}
@ -330,7 +330,7 @@ public class AccumulatorOperators { @@ -330,7 +330,7 @@ public class AccumulatorOperators {
*/
public Sum and(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Sum(append(value));
}
@ -372,7 +372,7 @@ public class AccumulatorOperators { @@ -372,7 +372,7 @@ public class AccumulatorOperators {
*/
public static Avg avgOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Avg(asFields(fieldReference));
}
@ -384,7 +384,7 @@ public class AccumulatorOperators { @@ -384,7 +384,7 @@ public class AccumulatorOperators {
*/
public static Avg avgOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Avg(Collections.singletonList(expression));
}
@ -397,7 +397,7 @@ public class AccumulatorOperators { @@ -397,7 +397,7 @@ public class AccumulatorOperators {
*/
public Avg and(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Avg(append(Fields.field(fieldReference)));
}
@ -410,7 +410,7 @@ public class AccumulatorOperators { @@ -410,7 +410,7 @@ public class AccumulatorOperators {
*/
public Avg and(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Avg(append(expression));
}
@ -452,7 +452,7 @@ public class AccumulatorOperators { @@ -452,7 +452,7 @@ public class AccumulatorOperators {
*/
public static Max maxOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Max(asFields(fieldReference));
}
@ -464,7 +464,7 @@ public class AccumulatorOperators { @@ -464,7 +464,7 @@ public class AccumulatorOperators {
*/
public static Max maxOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Max(Collections.singletonList(expression));
}
@ -477,7 +477,7 @@ public class AccumulatorOperators { @@ -477,7 +477,7 @@ public class AccumulatorOperators {
*/
public Max and(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Max(append(Fields.field(fieldReference)));
}
@ -490,7 +490,7 @@ public class AccumulatorOperators { @@ -490,7 +490,7 @@ public class AccumulatorOperators {
*/
public Max and(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Max(append(expression));
}
@ -532,7 +532,7 @@ public class AccumulatorOperators { @@ -532,7 +532,7 @@ public class AccumulatorOperators {
*/
public static Min minOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Min(asFields(fieldReference));
}
@ -544,7 +544,7 @@ public class AccumulatorOperators { @@ -544,7 +544,7 @@ public class AccumulatorOperators {
*/
public static Min minOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Min(Collections.singletonList(expression));
}
@ -557,7 +557,7 @@ public class AccumulatorOperators { @@ -557,7 +557,7 @@ public class AccumulatorOperators {
*/
public Min and(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Min(append(Fields.field(fieldReference)));
}
@ -570,7 +570,7 @@ public class AccumulatorOperators { @@ -570,7 +570,7 @@ public class AccumulatorOperators {
*/
public Min and(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Min(append(expression));
}
@ -612,7 +612,7 @@ public class AccumulatorOperators { @@ -612,7 +612,7 @@ public class AccumulatorOperators {
*/
public static StdDevPop stdDevPopOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new StdDevPop(asFields(fieldReference));
}
@ -624,7 +624,7 @@ public class AccumulatorOperators { @@ -624,7 +624,7 @@ public class AccumulatorOperators {
*/
public static StdDevPop stdDevPopOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new StdDevPop(Collections.singletonList(expression));
}
@ -637,7 +637,7 @@ public class AccumulatorOperators { @@ -637,7 +637,7 @@ public class AccumulatorOperators {
*/
public StdDevPop and(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new StdDevPop(append(Fields.field(fieldReference)));
}
@ -650,7 +650,7 @@ public class AccumulatorOperators { @@ -650,7 +650,7 @@ public class AccumulatorOperators {
*/
public StdDevPop and(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new StdDevPop(append(expression));
}
@ -692,7 +692,7 @@ public class AccumulatorOperators { @@ -692,7 +692,7 @@ public class AccumulatorOperators {
*/
public static StdDevSamp stdDevSampOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new StdDevSamp(asFields(fieldReference));
}
@ -704,7 +704,7 @@ public class AccumulatorOperators { @@ -704,7 +704,7 @@ public class AccumulatorOperators {
*/
public static StdDevSamp stdDevSampOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new StdDevSamp(Collections.singletonList(expression));
}
@ -717,7 +717,7 @@ public class AccumulatorOperators { @@ -717,7 +717,7 @@ public class AccumulatorOperators {
*/
public StdDevSamp and(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new StdDevSamp(append(Fields.field(fieldReference)));
}
@ -730,7 +730,7 @@ public class AccumulatorOperators { @@ -730,7 +730,7 @@ public class AccumulatorOperators {
*/
public StdDevSamp and(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new StdDevSamp(append(expression));
}
@ -768,7 +768,7 @@ public class AccumulatorOperators { @@ -768,7 +768,7 @@ public class AccumulatorOperators {
*/
public static CovariancePop covariancePopOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new CovariancePop(asFields(fieldReference));
}
@ -828,7 +828,7 @@ public class AccumulatorOperators { @@ -828,7 +828,7 @@ public class AccumulatorOperators {
*/
public static CovarianceSamp covarianceSampOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new CovarianceSamp(asFields(fieldReference));
}

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java

@ -138,7 +138,7 @@ public class Aggregation { @@ -138,7 +138,7 @@ public class Aggregation {
*/
public Aggregation withOptions(AggregationOptions options) {
Assert.notNull(options, "AggregationOptions must not be null.");
Assert.notNull(options, "AggregationOptions must not be null");
return new Aggregation(this.pipeline.getOperations(), options);
}
@ -177,7 +177,7 @@ public class Aggregation { @@ -177,7 +177,7 @@ public class Aggregation {
*/
protected static List<AggregationOperation> asAggregationList(AggregationOperation... aggregationOperations) {
Assert.notEmpty(aggregationOperations, "AggregationOperations must not be null or empty!");
Assert.notEmpty(aggregationOperations, "AggregationOperations must not be null or empty");
return Arrays.asList(aggregationOperations);
}
@ -199,8 +199,8 @@ public class Aggregation { @@ -199,8 +199,8 @@ public class Aggregation {
*/
protected Aggregation(List<AggregationOperation> aggregationOperations, AggregationOptions options) {
Assert.notNull(aggregationOperations, "AggregationOperations must not be null!");
Assert.notNull(options, "AggregationOptions must not be null!");
Assert.notNull(aggregationOperations, "AggregationOperations must not be null");
Assert.notNull(options, "AggregationOptions must not be null");
this.pipeline = new AggregationPipeline(aggregationOperations);
this.options = options;
@ -267,7 +267,7 @@ public class Aggregation { @@ -267,7 +267,7 @@ public class Aggregation {
*/
public static ProjectionOperation project(Class<?> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
return new ProjectionOperation(type);
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationExpressionTransformer.java

@ -60,7 +60,7 @@ interface AggregationExpressionTransformer @@ -60,7 +60,7 @@ interface AggregationExpressionTransformer
super(currentNode, parentNode, previousOperationObject);
Assert.notNull(context, "AggregationOperationContext must not be null!");
Assert.notNull(context, "AggregationOperationContext must not be null");
this.aggregationContext = context;
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationContext.java

@ -86,7 +86,7 @@ public interface AggregationOperationContext { @@ -86,7 +86,7 @@ public interface AggregationOperationContext {
*/
default Fields getFields(Class<?> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
return Fields.fields(Arrays.stream(BeanUtils.getPropertyDescriptors(type)) //
.filter(it -> { // object and default methods

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java

@ -144,7 +144,7 @@ public class AggregationOptions { @@ -144,7 +144,7 @@ public class AggregationOptions {
*/
public static AggregationOptions fromDocument(Document document) {
Assert.notNull(document, "Document must not be null!");
Assert.notNull(document, "Document must not be null");
boolean allowDiskUse = document.getBoolean(ALLOW_DISK_USE, false);
boolean explain = document.getBoolean(EXPLAIN, false);

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationPipeline.java

@ -48,7 +48,7 @@ public class AggregationPipeline { @@ -48,7 +48,7 @@ public class AggregationPipeline {
*/
public AggregationPipeline(List<AggregationOperation> aggregationOperations) {
Assert.notNull(aggregationOperations, "AggregationOperations must not be null!");
Assert.notNull(aggregationOperations, "AggregationOperations must not be null");
pipeline = new ArrayList<>(aggregationOperations);
}
@ -60,7 +60,7 @@ public class AggregationPipeline { @@ -60,7 +60,7 @@ public class AggregationPipeline {
*/
public AggregationPipeline add(AggregationOperation aggregationOperation) {
Assert.notNull(aggregationOperation, "AggregationOperation must not be null!");
Assert.notNull(aggregationOperation, "AggregationOperation must not be null");
pipeline.add(aggregationOperation);
return this;
@ -100,11 +100,11 @@ public class AggregationPipeline { @@ -100,11 +100,11 @@ public class AggregationPipeline {
for (AggregationOperation operation : pipeline) {
if (isOut(operation) && !isLast(operation)) {
throw new IllegalArgumentException("The $out operator must be the last stage in the pipeline.");
throw new IllegalArgumentException("The $out operator must be the last stage in the pipeline");
}
if (isMerge(operation) && !isLast(operation)) {
throw new IllegalArgumentException("The $merge operator must be the last stage in the pipeline.");
throw new IllegalArgumentException("The $merge operator must be the last stage in the pipeline");
}
}
}

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationResults.java

@ -48,8 +48,8 @@ public class AggregationResults<T> implements Iterable<T> { @@ -48,8 +48,8 @@ public class AggregationResults<T> implements Iterable<T> {
*/
public AggregationResults(List<T> mappedResults, Document rawResults) {
Assert.notNull(mappedResults, "List of mapped results must not be null!");
Assert.notNull(rawResults, "Raw results must not be null!");
Assert.notNull(mappedResults, "List of mapped results must not be null");
Assert.notNull(rawResults, "Raw results must not be null");
this.mappedResults = Collections.unmodifiableList(mappedResults);
this.rawResults = rawResults;
@ -73,7 +73,7 @@ public class AggregationResults<T> implements Iterable<T> { @@ -73,7 +73,7 @@ public class AggregationResults<T> implements Iterable<T> {
*/
@Nullable
public T getUniqueMappedResult() {
Assert.isTrue(mappedResults.size() < 2, "Expected unique result or null, but got more than one!");
Assert.isTrue(mappedResults.size() < 2, "Expected unique result or null, but got more than one");
return mappedResults.size() == 1 ? mappedResults.get(0) : null;
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationSpELExpression.java

@ -60,7 +60,7 @@ public class AggregationSpELExpression implements AggregationExpression { @@ -60,7 +60,7 @@ public class AggregationSpELExpression implements AggregationExpression {
*/
public static AggregationSpELExpression expressionOf(String expressionString, Object... parameters) {
Assert.notNull(expressionString, "ExpressionString must not be null!");
Assert.notNull(expressionString, "ExpressionString must not be null");
return new AggregationSpELExpression(expressionString, parameters);
}

16
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUpdate.java

@ -133,7 +133,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { @@ -133,7 +133,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition {
*/
public AggregationUpdate set(SetOperation setOperation) {
Assert.notNull(setOperation, "SetOperation must not be null!");
Assert.notNull(setOperation, "SetOperation must not be null");
setOperation.getFields().forEach(it -> {
keysTouched.add(it.getName());
@ -152,7 +152,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { @@ -152,7 +152,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition {
*/
public AggregationUpdate unset(UnsetOperation unsetOperation) {
Assert.notNull(unsetOperation, "UnsetOperation must not be null!");
Assert.notNull(unsetOperation, "UnsetOperation must not be null");
pipeline.add(unsetOperation);
keysTouched.addAll(unsetOperation.removedFieldNames());
@ -170,7 +170,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { @@ -170,7 +170,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition {
*/
public AggregationUpdate replaceWith(ReplaceWithOperation replaceWithOperation) {
Assert.notNull(replaceWithOperation, "ReplaceWithOperation must not be null!");
Assert.notNull(replaceWithOperation, "ReplaceWithOperation must not be null");
pipeline.add(replaceWithOperation);
return this;
}
@ -183,7 +183,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { @@ -183,7 +183,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition {
*/
public AggregationUpdate replaceWith(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return replaceWith(ReplaceWithOperation.replaceWithValue(value));
}
@ -197,7 +197,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { @@ -197,7 +197,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition {
*/
public SetValueAppender set(String key) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(key, "Key must not be null");
return new SetValueAppender() {
@ -209,7 +209,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { @@ -209,7 +209,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition {
@Override
public AggregationUpdate toValueOf(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return set(SetOperation.builder().set(key).toValueOf(value));
}
};
@ -223,8 +223,8 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { @@ -223,8 +223,8 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition {
*/
public AggregationUpdate unset(String... keys) {
Assert.notNull(keys, "Keys must not be null!");
Assert.noNullElements(keys, "Keys must not contain null elements.");
Assert.notNull(keys, "Keys must not be null");
Assert.noNullElements(keys, "Keys must not contain null elements");
return unset(new UnsetOperation(Arrays.stream(keys).map(Fields::field).collect(Collectors.toList())));
}

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUtils.java

@ -36,11 +36,11 @@ interface AggregationUtils { @@ -36,11 +36,11 @@ interface AggregationUtils {
*/
static List<Long> toRangeValues(Range<Long> range) {
Assert.notNull(range, "Range must not be null!");
Assert.notNull(range, "Range must not be null");
List<Long> result = new ArrayList<Long>(2);
result.add(range.getLowerBound().getValue()
.orElseThrow(() -> new IllegalArgumentException("Lower bound of range must be bounded!")));
.orElseThrow(() -> new IllegalArgumentException("Lower bound of range must be bounded")));
range.getUpperBound().getValue().ifPresent(it -> result.add(it));
return result;

196
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArithmeticOperators.java

@ -91,7 +91,7 @@ public class ArithmeticOperators { @@ -91,7 +91,7 @@ public class ArithmeticOperators {
*/
public ArithmeticOperatorFactory(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
this.fieldReference = fieldReference;
this.expression = null;
}
@ -103,7 +103,7 @@ public class ArithmeticOperators { @@ -103,7 +103,7 @@ public class ArithmeticOperators {
*/
public ArithmeticOperatorFactory(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
this.fieldReference = null;
this.expression = expression;
}
@ -126,7 +126,7 @@ public class ArithmeticOperators { @@ -126,7 +126,7 @@ public class ArithmeticOperators {
*/
public Add add(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createAdd().add(fieldReference);
}
@ -139,7 +139,7 @@ public class ArithmeticOperators { @@ -139,7 +139,7 @@ public class ArithmeticOperators {
*/
public Add add(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createAdd().add(expression);
}
@ -151,7 +151,7 @@ public class ArithmeticOperators { @@ -151,7 +151,7 @@ public class ArithmeticOperators {
*/
public Add add(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return createAdd().add(value);
}
@ -218,7 +218,7 @@ public class ArithmeticOperators { @@ -218,7 +218,7 @@ public class ArithmeticOperators {
*/
public Divide divideBy(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createDivide().divideBy(fieldReference);
}
@ -231,7 +231,7 @@ public class ArithmeticOperators { @@ -231,7 +231,7 @@ public class ArithmeticOperators {
*/
public Divide divideBy(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createDivide().divideBy(expression);
}
@ -243,7 +243,7 @@ public class ArithmeticOperators { @@ -243,7 +243,7 @@ public class ArithmeticOperators {
*/
public Divide divideBy(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return createDivide().divideBy(value);
}
@ -304,7 +304,7 @@ public class ArithmeticOperators { @@ -304,7 +304,7 @@ public class ArithmeticOperators {
*/
public Integral integral(String unit) {
Assert.hasText(unit, "Unit must not be empty!");
Assert.hasText(unit, "Unit must not be empty");
return integral().unit(unit);
}
@ -328,7 +328,7 @@ public class ArithmeticOperators { @@ -328,7 +328,7 @@ public class ArithmeticOperators {
*/
public Log log(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createLog().log(fieldReference);
}
@ -341,7 +341,7 @@ public class ArithmeticOperators { @@ -341,7 +341,7 @@ public class ArithmeticOperators {
*/
public Log log(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createLog().log(fieldReference);
}
@ -354,7 +354,7 @@ public class ArithmeticOperators { @@ -354,7 +354,7 @@ public class ArithmeticOperators {
*/
public Log log(Number base) {
Assert.notNull(base, "Base must not be null!");
Assert.notNull(base, "Base must not be null");
return createLog().log(base);
}
@ -380,7 +380,7 @@ public class ArithmeticOperators { @@ -380,7 +380,7 @@ public class ArithmeticOperators {
*/
public Mod mod(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createMod().mod(fieldReference);
}
@ -393,7 +393,7 @@ public class ArithmeticOperators { @@ -393,7 +393,7 @@ public class ArithmeticOperators {
*/
public Mod mod(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createMod().mod(expression);
}
@ -406,7 +406,7 @@ public class ArithmeticOperators { @@ -406,7 +406,7 @@ public class ArithmeticOperators {
*/
public Mod mod(Number value) {
Assert.notNull(value, "Base must not be null!");
Assert.notNull(value, "Base must not be null");
return createMod().mod(value);
}
@ -422,7 +422,7 @@ public class ArithmeticOperators { @@ -422,7 +422,7 @@ public class ArithmeticOperators {
*/
public Multiply multiplyBy(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createMultiply().multiplyBy(fieldReference);
}
@ -434,7 +434,7 @@ public class ArithmeticOperators { @@ -434,7 +434,7 @@ public class ArithmeticOperators {
*/
public Multiply multiplyBy(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createMultiply().multiplyBy(expression);
}
@ -446,7 +446,7 @@ public class ArithmeticOperators { @@ -446,7 +446,7 @@ public class ArithmeticOperators {
*/
public Multiply multiplyBy(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return createMultiply().multiplyBy(value);
}
@ -462,7 +462,7 @@ public class ArithmeticOperators { @@ -462,7 +462,7 @@ public class ArithmeticOperators {
*/
public Pow pow(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createPow().pow(fieldReference);
}
@ -474,7 +474,7 @@ public class ArithmeticOperators { @@ -474,7 +474,7 @@ public class ArithmeticOperators {
*/
public Pow pow(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createPow().pow(expression);
}
@ -486,7 +486,7 @@ public class ArithmeticOperators { @@ -486,7 +486,7 @@ public class ArithmeticOperators {
*/
public Pow pow(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return createPow().pow(value);
}
@ -511,7 +511,7 @@ public class ArithmeticOperators { @@ -511,7 +511,7 @@ public class ArithmeticOperators {
*/
public Subtract subtract(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createSubtract().subtract(fieldReference);
}
@ -523,7 +523,7 @@ public class ArithmeticOperators { @@ -523,7 +523,7 @@ public class ArithmeticOperators {
*/
public Subtract subtract(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createSubtract().subtract(expression);
}
@ -535,7 +535,7 @@ public class ArithmeticOperators { @@ -535,7 +535,7 @@ public class ArithmeticOperators {
*/
public Subtract subtract(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return createSubtract().subtract(value);
}
@ -851,7 +851,7 @@ public class ArithmeticOperators { @@ -851,7 +851,7 @@ public class ArithmeticOperators {
*/
public ATan2 atan2(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return createATan2().atan2of(value);
}
@ -865,7 +865,7 @@ public class ArithmeticOperators { @@ -865,7 +865,7 @@ public class ArithmeticOperators {
*/
public ATan2 atan2(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createATan2().atan2of(fieldReference);
}
@ -879,7 +879,7 @@ public class ArithmeticOperators { @@ -879,7 +879,7 @@ public class ArithmeticOperators {
*/
public ATan2 atan2(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createATan2().atan2of(expression);
}
@ -961,7 +961,7 @@ public class ArithmeticOperators { @@ -961,7 +961,7 @@ public class ArithmeticOperators {
*/
public static Abs absoluteValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Abs(Fields.field(fieldReference));
}
@ -973,7 +973,7 @@ public class ArithmeticOperators { @@ -973,7 +973,7 @@ public class ArithmeticOperators {
*/
public static Abs absoluteValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Abs(expression);
}
@ -985,7 +985,7 @@ public class ArithmeticOperators { @@ -985,7 +985,7 @@ public class ArithmeticOperators {
*/
public static Abs absoluteValueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Abs(value);
}
}
@ -1014,7 +1014,7 @@ public class ArithmeticOperators { @@ -1014,7 +1014,7 @@ public class ArithmeticOperators {
*/
public static Add valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Add(asFields(fieldReference));
}
@ -1026,7 +1026,7 @@ public class ArithmeticOperators { @@ -1026,7 +1026,7 @@ public class ArithmeticOperators {
*/
public static Add valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Add(Collections.singletonList(expression));
}
@ -1038,7 +1038,7 @@ public class ArithmeticOperators { @@ -1038,7 +1038,7 @@ public class ArithmeticOperators {
*/
public static Add valueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Add(Collections.singletonList(value));
}
@ -1050,7 +1050,7 @@ public class ArithmeticOperators { @@ -1050,7 +1050,7 @@ public class ArithmeticOperators {
*/
public Add add(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Add(append(Fields.field(fieldReference)));
}
@ -1062,7 +1062,7 @@ public class ArithmeticOperators { @@ -1062,7 +1062,7 @@ public class ArithmeticOperators {
*/
public Add add(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Add(append(expression));
}
@ -1101,7 +1101,7 @@ public class ArithmeticOperators { @@ -1101,7 +1101,7 @@ public class ArithmeticOperators {
*/
public static Ceil ceilValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Ceil(Fields.field(fieldReference));
}
@ -1113,7 +1113,7 @@ public class ArithmeticOperators { @@ -1113,7 +1113,7 @@ public class ArithmeticOperators {
*/
public static Ceil ceilValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Ceil(expression);
}
@ -1125,7 +1125,7 @@ public class ArithmeticOperators { @@ -1125,7 +1125,7 @@ public class ArithmeticOperators {
*/
public static Ceil ceilValueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Ceil(value);
}
}
@ -1154,7 +1154,7 @@ public class ArithmeticOperators { @@ -1154,7 +1154,7 @@ public class ArithmeticOperators {
*/
public static Divide valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Divide(asFields(fieldReference));
}
@ -1166,7 +1166,7 @@ public class ArithmeticOperators { @@ -1166,7 +1166,7 @@ public class ArithmeticOperators {
*/
public static Divide valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Divide(Collections.singletonList(expression));
}
@ -1178,7 +1178,7 @@ public class ArithmeticOperators { @@ -1178,7 +1178,7 @@ public class ArithmeticOperators {
*/
public static Divide valueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Divide(Collections.singletonList(value));
}
@ -1190,7 +1190,7 @@ public class ArithmeticOperators { @@ -1190,7 +1190,7 @@ public class ArithmeticOperators {
*/
public Divide divideBy(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Divide(append(Fields.field(fieldReference)));
}
@ -1202,7 +1202,7 @@ public class ArithmeticOperators { @@ -1202,7 +1202,7 @@ public class ArithmeticOperators {
*/
public Divide divideBy(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Divide(append(expression));
}
@ -1241,7 +1241,7 @@ public class ArithmeticOperators { @@ -1241,7 +1241,7 @@ public class ArithmeticOperators {
*/
public static Exp expValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Exp(Fields.field(fieldReference));
}
@ -1253,7 +1253,7 @@ public class ArithmeticOperators { @@ -1253,7 +1253,7 @@ public class ArithmeticOperators {
*/
public static Exp expValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Exp(expression);
}
@ -1265,7 +1265,7 @@ public class ArithmeticOperators { @@ -1265,7 +1265,7 @@ public class ArithmeticOperators {
*/
public static Exp expValueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Exp(value);
}
}
@ -1294,7 +1294,7 @@ public class ArithmeticOperators { @@ -1294,7 +1294,7 @@ public class ArithmeticOperators {
*/
public static Floor floorValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Floor(Fields.field(fieldReference));
}
@ -1306,7 +1306,7 @@ public class ArithmeticOperators { @@ -1306,7 +1306,7 @@ public class ArithmeticOperators {
*/
public static Floor floorValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Floor(expression);
}
@ -1318,7 +1318,7 @@ public class ArithmeticOperators { @@ -1318,7 +1318,7 @@ public class ArithmeticOperators {
*/
public static Floor floorValueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Floor(value);
}
}
@ -1347,7 +1347,7 @@ public class ArithmeticOperators { @@ -1347,7 +1347,7 @@ public class ArithmeticOperators {
*/
public static Ln lnValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Ln(Fields.field(fieldReference));
}
@ -1359,7 +1359,7 @@ public class ArithmeticOperators { @@ -1359,7 +1359,7 @@ public class ArithmeticOperators {
*/
public static Ln lnValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Ln(expression);
}
@ -1371,7 +1371,7 @@ public class ArithmeticOperators { @@ -1371,7 +1371,7 @@ public class ArithmeticOperators {
*/
public static Ln lnValueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Ln(value);
}
}
@ -1400,7 +1400,7 @@ public class ArithmeticOperators { @@ -1400,7 +1400,7 @@ public class ArithmeticOperators {
*/
public static Log valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Log(asFields(fieldReference));
}
@ -1412,7 +1412,7 @@ public class ArithmeticOperators { @@ -1412,7 +1412,7 @@ public class ArithmeticOperators {
*/
public static Log valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Log(Collections.singletonList(expression));
}
@ -1424,7 +1424,7 @@ public class ArithmeticOperators { @@ -1424,7 +1424,7 @@ public class ArithmeticOperators {
*/
public static Log valueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Log(Collections.singletonList(value));
}
@ -1436,7 +1436,7 @@ public class ArithmeticOperators { @@ -1436,7 +1436,7 @@ public class ArithmeticOperators {
*/
public Log log(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Log(append(Fields.field(fieldReference)));
}
@ -1448,7 +1448,7 @@ public class ArithmeticOperators { @@ -1448,7 +1448,7 @@ public class ArithmeticOperators {
*/
public Log log(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Log(append(expression));
}
@ -1487,7 +1487,7 @@ public class ArithmeticOperators { @@ -1487,7 +1487,7 @@ public class ArithmeticOperators {
*/
public static Log10 log10ValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Log10(Fields.field(fieldReference));
}
@ -1499,7 +1499,7 @@ public class ArithmeticOperators { @@ -1499,7 +1499,7 @@ public class ArithmeticOperators {
*/
public static Log10 log10ValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Log10(expression);
}
@ -1511,7 +1511,7 @@ public class ArithmeticOperators { @@ -1511,7 +1511,7 @@ public class ArithmeticOperators {
*/
public static Log10 log10ValueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Log10(value);
}
}
@ -1540,7 +1540,7 @@ public class ArithmeticOperators { @@ -1540,7 +1540,7 @@ public class ArithmeticOperators {
*/
public static Mod valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Mod(asFields(fieldReference));
}
@ -1552,7 +1552,7 @@ public class ArithmeticOperators { @@ -1552,7 +1552,7 @@ public class ArithmeticOperators {
*/
public static Mod valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Mod(Collections.singletonList(expression));
}
@ -1564,7 +1564,7 @@ public class ArithmeticOperators { @@ -1564,7 +1564,7 @@ public class ArithmeticOperators {
*/
public static Mod valueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Mod(Collections.singletonList(value));
}
@ -1576,7 +1576,7 @@ public class ArithmeticOperators { @@ -1576,7 +1576,7 @@ public class ArithmeticOperators {
*/
public Mod mod(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Mod(append(Fields.field(fieldReference)));
}
@ -1588,7 +1588,7 @@ public class ArithmeticOperators { @@ -1588,7 +1588,7 @@ public class ArithmeticOperators {
*/
public Mod mod(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Mod(append(expression));
}
@ -1627,7 +1627,7 @@ public class ArithmeticOperators { @@ -1627,7 +1627,7 @@ public class ArithmeticOperators {
*/
public static Multiply valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Multiply(asFields(fieldReference));
}
@ -1639,7 +1639,7 @@ public class ArithmeticOperators { @@ -1639,7 +1639,7 @@ public class ArithmeticOperators {
*/
public static Multiply valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Multiply(Collections.singletonList(expression));
}
@ -1651,7 +1651,7 @@ public class ArithmeticOperators { @@ -1651,7 +1651,7 @@ public class ArithmeticOperators {
*/
public static Multiply valueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Multiply(Collections.singletonList(value));
}
@ -1663,7 +1663,7 @@ public class ArithmeticOperators { @@ -1663,7 +1663,7 @@ public class ArithmeticOperators {
*/
public Multiply multiplyBy(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Multiply(append(Fields.field(fieldReference)));
}
@ -1675,7 +1675,7 @@ public class ArithmeticOperators { @@ -1675,7 +1675,7 @@ public class ArithmeticOperators {
*/
public Multiply multiplyBy(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Multiply(append(expression));
}
@ -1714,7 +1714,7 @@ public class ArithmeticOperators { @@ -1714,7 +1714,7 @@ public class ArithmeticOperators {
*/
public static Pow valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Pow(asFields(fieldReference));
}
@ -1726,7 +1726,7 @@ public class ArithmeticOperators { @@ -1726,7 +1726,7 @@ public class ArithmeticOperators {
*/
public static Pow valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Pow(Collections.singletonList(expression));
}
@ -1738,7 +1738,7 @@ public class ArithmeticOperators { @@ -1738,7 +1738,7 @@ public class ArithmeticOperators {
*/
public static Pow valueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Pow(Collections.singletonList(value));
}
@ -1750,7 +1750,7 @@ public class ArithmeticOperators { @@ -1750,7 +1750,7 @@ public class ArithmeticOperators {
*/
public Pow pow(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Pow(append(Fields.field(fieldReference)));
}
@ -1762,7 +1762,7 @@ public class ArithmeticOperators { @@ -1762,7 +1762,7 @@ public class ArithmeticOperators {
*/
public Pow pow(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Pow(append(expression));
}
@ -1801,7 +1801,7 @@ public class ArithmeticOperators { @@ -1801,7 +1801,7 @@ public class ArithmeticOperators {
*/
public static Sqrt sqrtOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Sqrt(Fields.field(fieldReference));
}
@ -1813,7 +1813,7 @@ public class ArithmeticOperators { @@ -1813,7 +1813,7 @@ public class ArithmeticOperators {
*/
public static Sqrt sqrtOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Sqrt(expression);
}
@ -1825,7 +1825,7 @@ public class ArithmeticOperators { @@ -1825,7 +1825,7 @@ public class ArithmeticOperators {
*/
public static Sqrt sqrtOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Sqrt(value);
}
}
@ -1854,7 +1854,7 @@ public class ArithmeticOperators { @@ -1854,7 +1854,7 @@ public class ArithmeticOperators {
*/
public static Subtract valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Subtract(asFields(fieldReference));
}
@ -1866,7 +1866,7 @@ public class ArithmeticOperators { @@ -1866,7 +1866,7 @@ public class ArithmeticOperators {
*/
public static Subtract valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Subtract(Collections.singletonList(expression));
}
@ -1878,7 +1878,7 @@ public class ArithmeticOperators { @@ -1878,7 +1878,7 @@ public class ArithmeticOperators {
*/
public static Subtract valueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Subtract(Collections.singletonList(value));
}
@ -1890,7 +1890,7 @@ public class ArithmeticOperators { @@ -1890,7 +1890,7 @@ public class ArithmeticOperators {
*/
public Subtract subtract(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Subtract(append(Fields.field(fieldReference)));
}
@ -1902,7 +1902,7 @@ public class ArithmeticOperators { @@ -1902,7 +1902,7 @@ public class ArithmeticOperators {
*/
public Subtract subtract(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Subtract(append(expression));
}
@ -1941,7 +1941,7 @@ public class ArithmeticOperators { @@ -1941,7 +1941,7 @@ public class ArithmeticOperators {
*/
public static Trunc truncValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Trunc(Fields.field(fieldReference));
}
@ -1953,7 +1953,7 @@ public class ArithmeticOperators { @@ -1953,7 +1953,7 @@ public class ArithmeticOperators {
*/
public static Trunc truncValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Trunc(expression);
}
@ -1965,7 +1965,7 @@ public class ArithmeticOperators { @@ -1965,7 +1965,7 @@ public class ArithmeticOperators {
*/
public static Trunc truncValueOf(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Trunc(value);
}
}
@ -1997,7 +1997,7 @@ public class ArithmeticOperators { @@ -1997,7 +1997,7 @@ public class ArithmeticOperators {
*/
public static Round roundValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Round(Collections.singletonList(Fields.field(fieldReference)));
}
@ -2009,7 +2009,7 @@ public class ArithmeticOperators { @@ -2009,7 +2009,7 @@ public class ArithmeticOperators {
*/
public static Round roundValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Round(Collections.singletonList(expression));
}
@ -2021,7 +2021,7 @@ public class ArithmeticOperators { @@ -2021,7 +2021,7 @@ public class ArithmeticOperators {
*/
public static Round round(Number value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Round(Collections.singletonList(value));
}
@ -2043,7 +2043,7 @@ public class ArithmeticOperators { @@ -2043,7 +2043,7 @@ public class ArithmeticOperators {
*/
public Round placeOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Round(append(expression));
}
@ -2056,7 +2056,7 @@ public class ArithmeticOperators { @@ -2056,7 +2056,7 @@ public class ArithmeticOperators {
*/
public Round placeOf(String fieldReference) {
Assert.notNull(fieldReference, "fieldReference must not be null!");
Assert.notNull(fieldReference, "fieldReference must not be null");
return new Round(append(Fields.field(fieldReference)));
}
@ -2400,7 +2400,7 @@ public class ArithmeticOperators { @@ -2400,7 +2400,7 @@ public class ArithmeticOperators {
*/
public static ASin asinOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new ASin(Fields.field(fieldReference));
}
@ -2704,7 +2704,7 @@ public class ArithmeticOperators { @@ -2704,7 +2704,7 @@ public class ArithmeticOperators {
*/
public static ACos acosOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new ACos(Fields.field(fieldReference));
}
@ -2905,7 +2905,7 @@ public class ArithmeticOperators { @@ -2905,7 +2905,7 @@ public class ArithmeticOperators {
*/
public static ATan atanOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new ATan(Fields.field(fieldReference));
}
@ -2958,7 +2958,7 @@ public class ArithmeticOperators { @@ -2958,7 +2958,7 @@ public class ArithmeticOperators {
*/
public static ATan2 valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new ATan2(asFields(fieldReference));
}
@ -2971,7 +2971,7 @@ public class ArithmeticOperators { @@ -2971,7 +2971,7 @@ public class ArithmeticOperators {
*/
public static ATan2 valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new ATan2((Collections.singletonList(expression)));
}
@ -2985,7 +2985,7 @@ public class ArithmeticOperators { @@ -2985,7 +2985,7 @@ public class ArithmeticOperators {
*/
public ATan2 atan2of(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new ATan2(append(Fields.field(fieldReference)));
}
@ -2999,7 +2999,7 @@ public class ArithmeticOperators { @@ -2999,7 +2999,7 @@ public class ArithmeticOperators {
*/
public ATan2 atan2of(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new ATan2(append(expression));
}

118
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArrayOperators.java

@ -87,7 +87,7 @@ public class ArrayOperators { @@ -87,7 +87,7 @@ public class ArrayOperators {
*/
public ArrayOperatorFactory(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
this.fieldReference = fieldReference;
this.expression = null;
this.values = null;
@ -100,7 +100,7 @@ public class ArrayOperators { @@ -100,7 +100,7 @@ public class ArrayOperators {
*/
public ArrayOperatorFactory(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
this.fieldReference = null;
this.expression = expression;
this.values = null;
@ -114,7 +114,7 @@ public class ArrayOperators { @@ -114,7 +114,7 @@ public class ArrayOperators {
*/
public ArrayOperatorFactory(Collection<?> values) {
Assert.notNull(values, "Values must not be null!");
Assert.notNull(values, "Values must not be null");
this.fieldReference = null;
this.expression = null;
this.values = values;
@ -140,7 +140,7 @@ public class ArrayOperators { @@ -140,7 +140,7 @@ public class ArrayOperators {
*/
public ArrayElemAt elementAt(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createArrayElemAt().elementAt(expression);
}
@ -153,7 +153,7 @@ public class ArrayOperators { @@ -153,7 +153,7 @@ public class ArrayOperators {
*/
public ArrayElemAt elementAt(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createArrayElemAt().elementAt(fieldReference);
}
@ -175,7 +175,7 @@ public class ArrayOperators { @@ -175,7 +175,7 @@ public class ArrayOperators {
*/
public ConcatArrays concat(String arrayFieldReference) {
Assert.notNull(arrayFieldReference, "ArrayFieldReference must not be null!");
Assert.notNull(arrayFieldReference, "ArrayFieldReference must not be null");
return createConcatArrays().concat(arrayFieldReference);
}
@ -188,7 +188,7 @@ public class ArrayOperators { @@ -188,7 +188,7 @@ public class ArrayOperators {
*/
public ConcatArrays concat(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createConcatArrays().concat(expression);
}
@ -213,7 +213,7 @@ public class ArrayOperators { @@ -213,7 +213,7 @@ public class ArrayOperators {
return Filter.filter(fieldReference);
}
Assert.state(values != null, "Values must not be null!");
Assert.state(values != null, "Values must not be null");
return Filter.filter(new ArrayList<>(values));
}
@ -224,7 +224,7 @@ public class ArrayOperators { @@ -224,7 +224,7 @@ public class ArrayOperators {
*/
public IsArray isArray() {
Assert.state(values == null, "Does it make sense to call isArray on an array? Maybe just skip it?");
Assert.state(values == null, "Does it make sense to call isArray on an array; Maybe just skip it");
return usesFieldRef() ? IsArray.isArray(fieldReference) : IsArray.isArray(expression);
}
@ -363,7 +363,7 @@ public class ArrayOperators { @@ -363,7 +363,7 @@ public class ArrayOperators {
return usesExpression() ? ArrayToObject.arrayValueOfToObject(expression) : ArrayToObject.arrayToObject(values);
}
/**
* Creates new {@link AggregationExpression} that return the first element in the associated array.
* <strong>NOTE:</strong> Requires MongoDB 4.4 or later.
@ -379,7 +379,7 @@ public class ArrayOperators { @@ -379,7 +379,7 @@ public class ArrayOperators {
return usesExpression() ? First.firstOf(expression) : First.first(values);
}
/**
* Creates new {@link AggregationExpression} that return the last element in the given array.
* <strong>NOTE:</strong> Requires MongoDB 4.4 or later.
@ -450,7 +450,7 @@ public class ArrayOperators { @@ -450,7 +450,7 @@ public class ArrayOperators {
*/
public static ArrayElemAt arrayOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new ArrayElemAt(asFields(fieldReference));
}
@ -462,7 +462,7 @@ public class ArrayOperators { @@ -462,7 +462,7 @@ public class ArrayOperators {
*/
public static ArrayElemAt arrayOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new ArrayElemAt(Collections.singletonList(expression));
}
@ -475,7 +475,7 @@ public class ArrayOperators { @@ -475,7 +475,7 @@ public class ArrayOperators {
*/
public static ArrayElemAt arrayOf(Collection<?> values) {
Assert.notNull(values, "Values must not be null!");
Assert.notNull(values, "Values must not be null");
return new ArrayElemAt(Collections.singletonList(values));
}
@ -497,7 +497,7 @@ public class ArrayOperators { @@ -497,7 +497,7 @@ public class ArrayOperators {
*/
public ArrayElemAt elementAt(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new ArrayElemAt(append(expression));
}
@ -509,7 +509,7 @@ public class ArrayOperators { @@ -509,7 +509,7 @@ public class ArrayOperators {
*/
public ArrayElemAt elementAt(String arrayFieldReference) {
Assert.notNull(arrayFieldReference, "ArrayReference must not be null!");
Assert.notNull(arrayFieldReference, "ArrayReference must not be null");
return new ArrayElemAt(append(Fields.field(arrayFieldReference)));
}
}
@ -538,7 +538,7 @@ public class ArrayOperators { @@ -538,7 +538,7 @@ public class ArrayOperators {
*/
public static ConcatArrays arrayOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new ConcatArrays(asFields(fieldReference));
}
@ -550,7 +550,7 @@ public class ArrayOperators { @@ -550,7 +550,7 @@ public class ArrayOperators {
*/
public static ConcatArrays arrayOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new ConcatArrays(Collections.singletonList(expression));
}
@ -563,7 +563,7 @@ public class ArrayOperators { @@ -563,7 +563,7 @@ public class ArrayOperators {
*/
public static ConcatArrays arrayOf(Collection<?> values) {
Assert.notNull(values, "Values must not be null!");
Assert.notNull(values, "Values must not be null");
return new ConcatArrays(Collections.singletonList(values));
}
@ -575,7 +575,7 @@ public class ArrayOperators { @@ -575,7 +575,7 @@ public class ArrayOperators {
*/
public ConcatArrays concat(String arrayFieldReference) {
Assert.notNull(arrayFieldReference, "ArrayFieldReference must not be null!");
Assert.notNull(arrayFieldReference, "ArrayFieldReference must not be null");
return new ConcatArrays(append(Fields.field(arrayFieldReference)));
}
@ -587,7 +587,7 @@ public class ArrayOperators { @@ -587,7 +587,7 @@ public class ArrayOperators {
*/
public ConcatArrays concat(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new ConcatArrays(append(expression));
}
}
@ -617,7 +617,7 @@ public class ArrayOperators { @@ -617,7 +617,7 @@ public class ArrayOperators {
*/
public static AsBuilder filter(String field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
return filter(Fields.field(field));
}
@ -629,7 +629,7 @@ public class ArrayOperators { @@ -629,7 +629,7 @@ public class ArrayOperators {
*/
public static AsBuilder filter(Field field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
return new FilterExpressionBuilder().filter(field);
}
@ -641,7 +641,7 @@ public class ArrayOperators { @@ -641,7 +641,7 @@ public class ArrayOperators {
*/
public static AsBuilder filter(List<?> values) {
Assert.notNull(values, "Values must not be null!");
Assert.notNull(values, "Values must not be null");
return new FilterExpressionBuilder().filter(values);
}
@ -768,7 +768,7 @@ public class ArrayOperators { @@ -768,7 +768,7 @@ public class ArrayOperators {
@Override
public AsBuilder filter(List<?> array) {
Assert.notNull(array, "Array must not be null!");
Assert.notNull(array, "Array must not be null");
filter.input = new ArrayList<Object>(array);
return this;
}
@ -776,7 +776,7 @@ public class ArrayOperators { @@ -776,7 +776,7 @@ public class ArrayOperators {
@Override
public AsBuilder filter(Field field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
filter.input = field;
return this;
}
@ -784,7 +784,7 @@ public class ArrayOperators { @@ -784,7 +784,7 @@ public class ArrayOperators {
@Override
public ConditionBuilder as(String variableName) {
Assert.notNull(variableName, "Variable name must not be null!");
Assert.notNull(variableName, "Variable name must not be null");
filter.as = new ExposedField(variableName, true);
return this;
}
@ -792,7 +792,7 @@ public class ArrayOperators { @@ -792,7 +792,7 @@ public class ArrayOperators {
@Override
public Filter by(AggregationExpression condition) {
Assert.notNull(condition, "Condition must not be null!");
Assert.notNull(condition, "Condition must not be null");
filter.condition = condition;
return filter;
}
@ -800,7 +800,7 @@ public class ArrayOperators { @@ -800,7 +800,7 @@ public class ArrayOperators {
@Override
public Filter by(String expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
filter.condition = expression;
return filter;
}
@ -808,7 +808,7 @@ public class ArrayOperators { @@ -808,7 +808,7 @@ public class ArrayOperators {
@Override
public Filter by(Document expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
filter.condition = expression;
return filter;
}
@ -839,7 +839,7 @@ public class ArrayOperators { @@ -839,7 +839,7 @@ public class ArrayOperators {
*/
public static IsArray isArray(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new IsArray(Fields.field(fieldReference));
}
@ -851,7 +851,7 @@ public class ArrayOperators { @@ -851,7 +851,7 @@ public class ArrayOperators {
*/
public static IsArray isArray(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new IsArray(expression);
}
}
@ -880,7 +880,7 @@ public class ArrayOperators { @@ -880,7 +880,7 @@ public class ArrayOperators {
*/
public static Size lengthOfArray(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Size(Fields.field(fieldReference));
}
@ -892,7 +892,7 @@ public class ArrayOperators { @@ -892,7 +892,7 @@ public class ArrayOperators {
*/
public static Size lengthOfArray(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Size(expression);
}
@ -905,7 +905,7 @@ public class ArrayOperators { @@ -905,7 +905,7 @@ public class ArrayOperators {
*/
public static Size lengthOfArray(Collection<?> values) {
Assert.notNull(values, "Values must not be null!");
Assert.notNull(values, "Values must not be null");
return new Size(Collections.singletonList(values));
}
}
@ -934,7 +934,7 @@ public class ArrayOperators { @@ -934,7 +934,7 @@ public class ArrayOperators {
*/
public static Slice sliceArrayOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Slice(asFields(fieldReference));
}
@ -946,7 +946,7 @@ public class ArrayOperators { @@ -946,7 +946,7 @@ public class ArrayOperators {
*/
public static Slice sliceArrayOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Slice(Collections.singletonList(expression));
}
@ -959,7 +959,7 @@ public class ArrayOperators { @@ -959,7 +959,7 @@ public class ArrayOperators {
*/
public static Slice sliceArrayOf(Collection<?> values) {
Assert.notNull(values, "Values must not be null!");
Assert.notNull(values, "Values must not be null");
return new Slice(Collections.singletonList(values));
}
@ -1029,7 +1029,7 @@ public class ArrayOperators { @@ -1029,7 +1029,7 @@ public class ArrayOperators {
*/
public static IndexOfArrayBuilder arrayOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new IndexOfArrayBuilder(Fields.field(fieldReference));
}
@ -1041,7 +1041,7 @@ public class ArrayOperators { @@ -1041,7 +1041,7 @@ public class ArrayOperators {
*/
public static IndexOfArrayBuilder arrayOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new IndexOfArrayBuilder(expression);
}
@ -1054,7 +1054,7 @@ public class ArrayOperators { @@ -1054,7 +1054,7 @@ public class ArrayOperators {
*/
public static IndexOfArrayBuilder arrayOf(Collection<?> values) {
Assert.notNull(values, "Values must not be null!");
Assert.notNull(values, "Values must not be null");
return new IndexOfArrayBuilder(values);
}
@ -1087,7 +1087,7 @@ public class ArrayOperators { @@ -1087,7 +1087,7 @@ public class ArrayOperators {
*/
public IndexOfArray indexOf(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new IndexOfArray(Arrays.asList(targetArray, value));
}
}
@ -1411,8 +1411,8 @@ public class ArrayOperators { @@ -1411,8 +1411,8 @@ public class ArrayOperators {
protected PropertyExpression(String propertyName, AggregationExpression aggregationExpression) {
Assert.notNull(propertyName, "Property name must not be null!");
Assert.notNull(aggregationExpression, "AggregationExpression must not be null!");
Assert.notNull(propertyName, "Property name must not be null");
Assert.notNull(aggregationExpression, "AggregationExpression must not be null");
this.propertyName = propertyName;
this.aggregationExpression = aggregationExpression;
@ -1559,7 +1559,7 @@ public class ArrayOperators { @@ -1559,7 +1559,7 @@ public class ArrayOperators {
*/
public static ZipBuilder arrayOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new ZipBuilder(Fields.field(fieldReference));
}
@ -1571,7 +1571,7 @@ public class ArrayOperators { @@ -1571,7 +1571,7 @@ public class ArrayOperators {
*/
public static ZipBuilder arrayOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new ZipBuilder(expression);
}
@ -1584,7 +1584,7 @@ public class ArrayOperators { @@ -1584,7 +1584,7 @@ public class ArrayOperators {
*/
public static ZipBuilder arrayOf(Collection<?> values) {
Assert.notNull(values, "Expression must not be null!");
Assert.notNull(values, "Expression must not be null");
return new ZipBuilder(values);
}
@ -1605,7 +1605,7 @@ public class ArrayOperators { @@ -1605,7 +1605,7 @@ public class ArrayOperators {
*/
public Zip defaultTo(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Zip(append("defaults", Fields.field(fieldReference)));
}
@ -1617,7 +1617,7 @@ public class ArrayOperators { @@ -1617,7 +1617,7 @@ public class ArrayOperators {
*/
public Zip defaultTo(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Zip(append("defaults", expression));
}
@ -1629,7 +1629,7 @@ public class ArrayOperators { @@ -1629,7 +1629,7 @@ public class ArrayOperators {
*/
public Zip defaultTo(Object[] array) {
Assert.notNull(array, "Array must not be null!");
Assert.notNull(array, "Array must not be null");
return new Zip(append("defaults", Arrays.asList(array)));
}
@ -1653,7 +1653,7 @@ public class ArrayOperators { @@ -1653,7 +1653,7 @@ public class ArrayOperators {
*/
public Zip zip(Object... arrays) {
Assert.notNull(arrays, "Arrays must not be null!");
Assert.notNull(arrays, "Arrays must not be null");
for (Object value : arrays) {
if (value instanceof String) {
@ -1696,11 +1696,11 @@ public class ArrayOperators { @@ -1696,11 +1696,11 @@ public class ArrayOperators {
*/
public static InBuilder arrayOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return value -> {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new In(Arrays.asList(value, Fields.field(fieldReference)));
};
}
@ -1713,11 +1713,11 @@ public class ArrayOperators { @@ -1713,11 +1713,11 @@ public class ArrayOperators {
*/
public static InBuilder arrayOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return value -> {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new In(Arrays.asList(value, expression));
};
@ -1732,11 +1732,11 @@ public class ArrayOperators { @@ -1732,11 +1732,11 @@ public class ArrayOperators {
*/
public static InBuilder arrayOf(Collection<?> values) {
Assert.notNull(values, "Values must not be null!");
Assert.notNull(values, "Values must not be null");
return value -> {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new In(Arrays.asList(value, values));
};
@ -1807,7 +1807,7 @@ public class ArrayOperators { @@ -1807,7 +1807,7 @@ public class ArrayOperators {
return "$arrayToObject";
}
}
/**
* {@link AggregationExpression} for {@code $first} that returns the first element in an array. <br />
* <strong>NOTE:</strong> Requires MongoDB 4.4 or later.
@ -1861,7 +1861,7 @@ public class ArrayOperators { @@ -1861,7 +1861,7 @@ public class ArrayOperators {
return "$first";
}
}
/**
* {@link AggregationExpression} for {@code $last} that returns the last element in an array. <br />
* <strong>NOTE:</strong> Requires MongoDB 4.4 or later.

30
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BooleanOperators.java

@ -87,7 +87,7 @@ public class BooleanOperators { @@ -87,7 +87,7 @@ public class BooleanOperators {
*/
public BooleanOperatorFactory(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
this.fieldReference = fieldReference;
this.expression = null;
}
@ -99,7 +99,7 @@ public class BooleanOperators { @@ -99,7 +99,7 @@ public class BooleanOperators {
*/
public BooleanOperatorFactory(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
this.fieldReference = null;
this.expression = expression;
}
@ -113,7 +113,7 @@ public class BooleanOperators { @@ -113,7 +113,7 @@ public class BooleanOperators {
*/
public And and(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createAnd().andExpression(expression);
}
@ -126,7 +126,7 @@ public class BooleanOperators { @@ -126,7 +126,7 @@ public class BooleanOperators {
*/
public And and(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createAnd().andField(fieldReference);
}
@ -143,7 +143,7 @@ public class BooleanOperators { @@ -143,7 +143,7 @@ public class BooleanOperators {
*/
public Or or(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createOr().orExpression(expression);
}
@ -156,7 +156,7 @@ public class BooleanOperators { @@ -156,7 +156,7 @@ public class BooleanOperators {
*/
public Or or(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createOr().orField(fieldReference);
}
@ -213,7 +213,7 @@ public class BooleanOperators { @@ -213,7 +213,7 @@ public class BooleanOperators {
*/
public And andExpression(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new And(append(expression));
}
@ -225,7 +225,7 @@ public class BooleanOperators { @@ -225,7 +225,7 @@ public class BooleanOperators {
*/
public And andField(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new And(append(Fields.field(fieldReference)));
}
@ -237,7 +237,7 @@ public class BooleanOperators { @@ -237,7 +237,7 @@ public class BooleanOperators {
*/
public And andValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new And(append(value));
}
}
@ -267,7 +267,7 @@ public class BooleanOperators { @@ -267,7 +267,7 @@ public class BooleanOperators {
*/
public static Or or(Object... expressions) {
Assert.notNull(expressions, "Expressions must not be null!");
Assert.notNull(expressions, "Expressions must not be null");
return new Or(Arrays.asList(expressions));
}
@ -279,7 +279,7 @@ public class BooleanOperators { @@ -279,7 +279,7 @@ public class BooleanOperators {
*/
public Or orExpression(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Or(append(expression));
}
@ -291,7 +291,7 @@ public class BooleanOperators { @@ -291,7 +291,7 @@ public class BooleanOperators {
*/
public Or orField(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Or(append(Fields.field(fieldReference)));
}
@ -303,7 +303,7 @@ public class BooleanOperators { @@ -303,7 +303,7 @@ public class BooleanOperators {
*/
public Or orValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Or(append(value));
}
}
@ -333,7 +333,7 @@ public class BooleanOperators { @@ -333,7 +333,7 @@ public class BooleanOperators {
*/
public static Not not(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Not(asFields(fieldReference));
}
@ -346,7 +346,7 @@ public class BooleanOperators { @@ -346,7 +346,7 @@ public class BooleanOperators {
*/
public static Not not(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Not(Collections.singletonList(expression));
}
}

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketAutoOperation.java

@ -50,7 +50,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat @@ -50,7 +50,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat
super(groupByField);
Assert.isTrue(buckets > 0, "Number of buckets must be greater 0!");
Assert.isTrue(buckets > 0, "Number of buckets must be greater 0");
this.buckets = buckets;
this.granularity = null;
@ -66,7 +66,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat @@ -66,7 +66,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat
super(groupByExpression);
Assert.isTrue(buckets > 0, "Number of buckets must be greater 0!");
Assert.isTrue(buckets > 0, "Number of buckets must be greater 0");
this.buckets = buckets;
this.granularity = null;
@ -117,7 +117,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat @@ -117,7 +117,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat
*/
public BucketAutoOperation withBuckets(int buckets) {
Assert.isTrue(buckets > 0, "Number of buckets must be greater 0!");
Assert.isTrue(buckets > 0, "Number of buckets must be greater 0");
return new BucketAutoOperation(this, buckets, granularity);
}
@ -132,7 +132,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat @@ -132,7 +132,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat
*/
public BucketAutoOperation withGranularity(Granularity granularity) {
Assert.notNull(granularity, "Granularity must not be null!");
Assert.notNull(granularity, "Granularity must not be null");
return new BucketAutoOperation(this, buckets, granularity.getMongoRepresentation());
}

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketOperation.java

@ -113,7 +113,7 @@ public class BucketOperation extends BucketOperationSupport<BucketOperation, Buc @@ -113,7 +113,7 @@ public class BucketOperation extends BucketOperationSupport<BucketOperation, Buc
*/
public BucketOperation withDefaultBucket(Object literal) {
Assert.notNull(literal, "Default bucket literal must not be null!");
Assert.notNull(literal, "Default bucket literal must not be null");
return new BucketOperation(this, boundaries, literal);
}
@ -126,8 +126,8 @@ public class BucketOperation extends BucketOperationSupport<BucketOperation, Buc @@ -126,8 +126,8 @@ public class BucketOperation extends BucketOperationSupport<BucketOperation, Buc
*/
public BucketOperation withBoundaries(Object... boundaries) {
Assert.notNull(boundaries, "Boundaries must not be null!");
Assert.noNullElements(boundaries, "Boundaries must not contain null values!");
Assert.notNull(boundaries, "Boundaries must not be null");
Assert.noNullElements(boundaries, "Boundaries must not contain null values");
List<Object> newBoundaries = new ArrayList<Object>(this.boundaries.size() + boundaries.length);
newBoundaries.addAll(this.boundaries);

30
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketOperationSupport.java

@ -51,7 +51,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -51,7 +51,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
*/
protected BucketOperationSupport(Field groupByField) {
Assert.notNull(groupByField, "Group by field must not be null!");
Assert.notNull(groupByField, "Group by field must not be null");
this.groupByField = groupByField;
this.groupByExpression = null;
@ -65,7 +65,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -65,7 +65,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
*/
protected BucketOperationSupport(AggregationExpression groupByExpression) {
Assert.notNull(groupByExpression, "Group by AggregationExpression must not be null!");
Assert.notNull(groupByExpression, "Group by AggregationExpression must not be null");
this.groupByExpression = groupByExpression;
this.groupByField = null;
@ -89,8 +89,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -89,8 +89,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
*/
protected BucketOperationSupport(BucketOperationSupport<?, ?> operationSupport, Outputs outputs) {
Assert.notNull(operationSupport, "BucketOperationSupport must not be null!");
Assert.notNull(outputs, "Outputs must not be null!");
Assert.notNull(operationSupport, "BucketOperationSupport must not be null");
Assert.notNull(outputs, "Outputs must not be null");
this.groupByField = operationSupport.groupByField;
this.groupByExpression = operationSupport.groupByExpression;
@ -213,8 +213,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -213,8 +213,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
*/
protected OutputBuilder(Object value, T operation) {
Assert.notNull(value, "Value must not be null or empty!");
Assert.notNull(operation, "ProjectionOperation must not be null!");
Assert.notNull(value, "Value must not be null or empty");
Assert.notNull(operation, "ProjectionOperation must not be null");
this.value = value;
this.operation = operation;
@ -321,8 +321,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -321,8 +321,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
*/
public B apply(String operation, Object... values) {
Assert.hasText(operation, "Operation must not be empty or null!");
Assert.notNull(value, "Values must not be null!");
Assert.hasText(operation, "Operation must not be empty or null");
Assert.notNull(value, "Values must not be null");
List<Object> objects = new ArrayList<Object>(values.length + 1);
objects.add(value);
@ -355,7 +355,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -355,7 +355,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
}
if (value instanceof Field) {
throw new IllegalStateException("Cannot add a field as top-level output. Use accumulator expressions.");
throw new IllegalStateException("Cannot add a field as top-level output; Use accumulator expressions");
}
return this.operation
@ -437,7 +437,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -437,7 +437,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
*/
protected Outputs and(Output output) {
Assert.notNull(output, "BucketOutput must not be null!");
Assert.notNull(output, "BucketOutput must not be null");
return new Outputs(this.outputs, output);
}
@ -480,7 +480,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -480,7 +480,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
*/
protected Output(Field field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
this.field = new ExposedField(field, true);
}
@ -516,8 +516,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -516,8 +516,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
super(Fields.field(operation));
Assert.hasText(operation, "Operation must not be null or empty!");
Assert.notNull(values, "Values must not be null!");
Assert.hasText(operation, "Operation must not be null or empty");
Assert.notNull(values, "Values must not be null");
this.operation = operation;
this.values = new ArrayList<Object>(values);
@ -616,8 +616,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T, @@ -616,8 +616,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
super(Fields.field(expression));
Assert.hasText(expression, "Expression must not be null!");
Assert.notNull(parameters, "Parameters must not be null!");
Assert.hasText(expression, "Expression must not be null");
Assert.notNull(parameters, "Parameters must not be null");
this.expression = expression;
this.params = parameters.clone();

74
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ComparisonOperators.java

@ -60,7 +60,7 @@ public class ComparisonOperators { @@ -60,7 +60,7 @@ public class ComparisonOperators {
*/
public ComparisonOperatorFactory(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
this.fieldReference = fieldReference;
this.expression = null;
}
@ -72,7 +72,7 @@ public class ComparisonOperators { @@ -72,7 +72,7 @@ public class ComparisonOperators {
*/
public ComparisonOperatorFactory(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
this.fieldReference = null;
this.expression = expression;
}
@ -362,7 +362,7 @@ public class ComparisonOperators { @@ -362,7 +362,7 @@ public class ComparisonOperators {
*/
public static Cmp valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Cmp(asFields(fieldReference));
}
@ -374,7 +374,7 @@ public class ComparisonOperators { @@ -374,7 +374,7 @@ public class ComparisonOperators {
*/
public static Cmp valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Cmp(Collections.singletonList(expression));
}
@ -386,7 +386,7 @@ public class ComparisonOperators { @@ -386,7 +386,7 @@ public class ComparisonOperators {
*/
public Cmp compareTo(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Cmp(append(Fields.field(fieldReference)));
}
@ -398,7 +398,7 @@ public class ComparisonOperators { @@ -398,7 +398,7 @@ public class ComparisonOperators {
*/
public Cmp compareTo(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Cmp(append(expression));
}
@ -410,7 +410,7 @@ public class ComparisonOperators { @@ -410,7 +410,7 @@ public class ComparisonOperators {
*/
public Cmp compareToValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Cmp(append(value, Expand.KEEP_SOURCE));
}
}
@ -439,7 +439,7 @@ public class ComparisonOperators { @@ -439,7 +439,7 @@ public class ComparisonOperators {
*/
public static Eq valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Eq(asFields(fieldReference));
}
@ -451,7 +451,7 @@ public class ComparisonOperators { @@ -451,7 +451,7 @@ public class ComparisonOperators {
*/
public static Eq valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Eq(Collections.singletonList(expression));
}
@ -463,7 +463,7 @@ public class ComparisonOperators { @@ -463,7 +463,7 @@ public class ComparisonOperators {
*/
public Eq equalTo(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Eq(append(Fields.field(fieldReference)));
}
@ -475,7 +475,7 @@ public class ComparisonOperators { @@ -475,7 +475,7 @@ public class ComparisonOperators {
*/
public Eq equalTo(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Eq(append(expression));
}
@ -487,7 +487,7 @@ public class ComparisonOperators { @@ -487,7 +487,7 @@ public class ComparisonOperators {
*/
public Eq equalToValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Eq(append(value, Expand.KEEP_SOURCE));
}
}
@ -516,7 +516,7 @@ public class ComparisonOperators { @@ -516,7 +516,7 @@ public class ComparisonOperators {
*/
public static Gt valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Gt(asFields(fieldReference));
}
@ -528,7 +528,7 @@ public class ComparisonOperators { @@ -528,7 +528,7 @@ public class ComparisonOperators {
*/
public static Gt valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Gt(Collections.singletonList(expression));
}
@ -540,7 +540,7 @@ public class ComparisonOperators { @@ -540,7 +540,7 @@ public class ComparisonOperators {
*/
public Gt greaterThan(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Gt(append(Fields.field(fieldReference)));
}
@ -552,7 +552,7 @@ public class ComparisonOperators { @@ -552,7 +552,7 @@ public class ComparisonOperators {
*/
public Gt greaterThan(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Gt(append(expression));
}
@ -564,7 +564,7 @@ public class ComparisonOperators { @@ -564,7 +564,7 @@ public class ComparisonOperators {
*/
public Gt greaterThanValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Gt(append(value));
}
}
@ -593,7 +593,7 @@ public class ComparisonOperators { @@ -593,7 +593,7 @@ public class ComparisonOperators {
*/
public static Lt valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Lt(asFields(fieldReference));
}
@ -605,7 +605,7 @@ public class ComparisonOperators { @@ -605,7 +605,7 @@ public class ComparisonOperators {
*/
public static Lt valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Lt(Collections.singletonList(expression));
}
@ -617,7 +617,7 @@ public class ComparisonOperators { @@ -617,7 +617,7 @@ public class ComparisonOperators {
*/
public Lt lessThan(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Lt(append(Fields.field(fieldReference)));
}
@ -629,7 +629,7 @@ public class ComparisonOperators { @@ -629,7 +629,7 @@ public class ComparisonOperators {
*/
public Lt lessThan(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Lt(append(expression));
}
@ -641,7 +641,7 @@ public class ComparisonOperators { @@ -641,7 +641,7 @@ public class ComparisonOperators {
*/
public Lt lessThanValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Lt(append(value));
}
}
@ -670,7 +670,7 @@ public class ComparisonOperators { @@ -670,7 +670,7 @@ public class ComparisonOperators {
*/
public static Gte valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Gte(asFields(fieldReference));
}
@ -682,7 +682,7 @@ public class ComparisonOperators { @@ -682,7 +682,7 @@ public class ComparisonOperators {
*/
public static Gte valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Gte(Collections.singletonList(expression));
}
@ -694,7 +694,7 @@ public class ComparisonOperators { @@ -694,7 +694,7 @@ public class ComparisonOperators {
*/
public Gte greaterThanEqualTo(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Gte(append(Fields.field(fieldReference)));
}
@ -706,7 +706,7 @@ public class ComparisonOperators { @@ -706,7 +706,7 @@ public class ComparisonOperators {
*/
public Gte greaterThanEqualTo(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Gte(append(expression));
}
@ -718,7 +718,7 @@ public class ComparisonOperators { @@ -718,7 +718,7 @@ public class ComparisonOperators {
*/
public Gte greaterThanEqualToValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Gte(append(value));
}
}
@ -747,7 +747,7 @@ public class ComparisonOperators { @@ -747,7 +747,7 @@ public class ComparisonOperators {
*/
public static Lte valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Lte(asFields(fieldReference));
}
@ -759,7 +759,7 @@ public class ComparisonOperators { @@ -759,7 +759,7 @@ public class ComparisonOperators {
*/
public static Lte valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Lte(Collections.singletonList(expression));
}
@ -771,7 +771,7 @@ public class ComparisonOperators { @@ -771,7 +771,7 @@ public class ComparisonOperators {
*/
public Lte lessThanEqualTo(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Lte(append(Fields.field(fieldReference)));
}
@ -783,7 +783,7 @@ public class ComparisonOperators { @@ -783,7 +783,7 @@ public class ComparisonOperators {
*/
public Lte lessThanEqualTo(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Lte(append(expression));
}
@ -795,7 +795,7 @@ public class ComparisonOperators { @@ -795,7 +795,7 @@ public class ComparisonOperators {
*/
public Lte lessThanEqualToValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Lte(append(value));
}
}
@ -824,7 +824,7 @@ public class ComparisonOperators { @@ -824,7 +824,7 @@ public class ComparisonOperators {
*/
public static Ne valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Ne(asFields(fieldReference));
}
@ -836,7 +836,7 @@ public class ComparisonOperators { @@ -836,7 +836,7 @@ public class ComparisonOperators {
*/
public static Ne valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Ne(Collections.singletonList(expression));
}
@ -848,7 +848,7 @@ public class ComparisonOperators { @@ -848,7 +848,7 @@ public class ComparisonOperators {
*/
public Ne notEqualTo(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Ne(append(Fields.field(fieldReference)));
}
@ -860,7 +860,7 @@ public class ComparisonOperators { @@ -860,7 +860,7 @@ public class ComparisonOperators {
*/
public Ne notEqualTo(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Ne(append(expression));
}
@ -872,7 +872,7 @@ public class ComparisonOperators { @@ -872,7 +872,7 @@ public class ComparisonOperators {
*/
public Ne notEqualToValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Ne(append(value, Expand.KEEP_SOURCE));
}
}

64
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConditionalOperators.java

@ -80,7 +80,7 @@ public class ConditionalOperators { @@ -80,7 +80,7 @@ public class ConditionalOperators {
*/
public static IfNull.ThenBuilder ifNull(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return IfNull.ifNull(fieldReference);
}
@ -94,7 +94,7 @@ public class ConditionalOperators { @@ -94,7 +94,7 @@ public class ConditionalOperators {
*/
public static IfNull.ThenBuilder ifNull(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return IfNull.ifNull(expression);
}
@ -137,7 +137,7 @@ public class ConditionalOperators { @@ -137,7 +137,7 @@ public class ConditionalOperators {
*/
public ConditionalOperatorFactory(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
this.fieldReference = fieldReference;
this.expression = null;
@ -151,7 +151,7 @@ public class ConditionalOperators { @@ -151,7 +151,7 @@ public class ConditionalOperators {
*/
public ConditionalOperatorFactory(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
this.fieldReference = null;
this.expression = expression;
@ -165,7 +165,7 @@ public class ConditionalOperators { @@ -165,7 +165,7 @@ public class ConditionalOperators {
*/
public ConditionalOperatorFactory(CriteriaDefinition criteriaDefinition) {
Assert.notNull(criteriaDefinition, "CriteriaDefinition must not be null!");
Assert.notNull(criteriaDefinition, "CriteriaDefinition must not be null");
this.fieldReference = null;
this.expression = null;
@ -181,7 +181,7 @@ public class ConditionalOperators { @@ -181,7 +181,7 @@ public class ConditionalOperators {
*/
public OtherwiseBuilder then(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return createThenBuilder().then(value);
}
@ -194,7 +194,7 @@ public class ConditionalOperators { @@ -194,7 +194,7 @@ public class ConditionalOperators {
*/
public OtherwiseBuilder thenValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return createThenBuilder().then(expression);
}
@ -207,7 +207,7 @@ public class ConditionalOperators { @@ -207,7 +207,7 @@ public class ConditionalOperators {
*/
public OtherwiseBuilder thenValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return createThenBuilder().thenValueOf(fieldReference);
}
@ -258,7 +258,7 @@ public class ConditionalOperators { @@ -258,7 +258,7 @@ public class ConditionalOperators {
*/
public static ThenBuilder ifNull(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new IfNullOperatorBuilder().ifNull(fieldReference);
}
@ -271,7 +271,7 @@ public class ConditionalOperators { @@ -271,7 +271,7 @@ public class ConditionalOperators {
*/
public static ThenBuilder ifNull(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new IfNullOperatorBuilder().ifNull(expression);
}
@ -406,7 +406,7 @@ public class ConditionalOperators { @@ -406,7 +406,7 @@ public class ConditionalOperators {
public ThenBuilder ifNull(String fieldReference) {
Assert.hasText(fieldReference, "FieldReference name must not be null or empty!");
Assert.hasText(fieldReference, "FieldReference name must not be null or empty");
this.conditions.add(Fields.field(fieldReference));
return this;
}
@ -414,7 +414,7 @@ public class ConditionalOperators { @@ -414,7 +414,7 @@ public class ConditionalOperators {
@Override
public ThenBuilder ifNull(AggregationExpression expression) {
Assert.notNull(expression, "AggregationExpression name must not be null or empty!");
Assert.notNull(expression, "AggregationExpression name must not be null or empty");
this.conditions.add(expression);
return this;
}
@ -435,13 +435,13 @@ public class ConditionalOperators { @@ -435,13 +435,13 @@ public class ConditionalOperators {
public IfNull thenValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new IfNull(conditions, Fields.field(fieldReference));
}
public IfNull thenValueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new IfNull(conditions, expression);
}
}
@ -470,7 +470,7 @@ public class ConditionalOperators { @@ -470,7 +470,7 @@ public class ConditionalOperators {
*/
public static Switch switchCases(CaseOperator... conditions) {
Assert.notNull(conditions, "Conditions must not be null!");
Assert.notNull(conditions, "Conditions must not be null");
return switchCases(Arrays.asList(conditions));
}
@ -481,7 +481,7 @@ public class ConditionalOperators { @@ -481,7 +481,7 @@ public class ConditionalOperators {
*/
public static Switch switchCases(List<CaseOperator> conditions) {
Assert.notNull(conditions, "Conditions must not be null!");
Assert.notNull(conditions, "Conditions must not be null");
return new Switch(Collections.<String, Object> singletonMap("branches", new ArrayList<CaseOperator>(conditions)));
}
@ -511,14 +511,14 @@ public class ConditionalOperators { @@ -511,14 +511,14 @@ public class ConditionalOperators {
public static ThenBuilder when(final AggregationExpression condition) {
Assert.notNull(condition, "Condition must not be null!");
Assert.notNull(condition, "Condition must not be null");
return new ThenBuilder() {
@Override
public CaseOperator then(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new CaseOperator(condition, value);
}
};
@ -598,9 +598,9 @@ public class ConditionalOperators { @@ -598,9 +598,9 @@ public class ConditionalOperators {
private Cond(Object condition, Object thenValue, Object otherwiseValue) {
Assert.notNull(condition, "Condition must not be null!");
Assert.notNull(thenValue, "Then value must not be null!");
Assert.notNull(otherwiseValue, "Otherwise value must not be null!");
Assert.notNull(condition, "Condition must not be null");
Assert.notNull(thenValue, "Then value must not be null");
Assert.notNull(otherwiseValue, "Otherwise value must not be null");
assertNotBuilder(condition, "Condition");
assertNotBuilder(thenValue, "Then value");
@ -657,7 +657,7 @@ public class ConditionalOperators { @@ -657,7 +657,7 @@ public class ConditionalOperators {
}
throw new InvalidDataAccessApiUsageException(
String.format("Invalid value in condition. Supported: Document, Field references, Criteria, got: %s", value));
String.format("Invalid value in condition; Supported: Document, Field references, Criteria, got: %s", value));
}
private List<Object> getClauses(AggregationOperationContext context, Document mappedObject) {
@ -892,7 +892,7 @@ public class ConditionalOperators { @@ -892,7 +892,7 @@ public class ConditionalOperators {
@Override
public ConditionalExpressionBuilder when(Document booleanExpression) {
Assert.notNull(booleanExpression, "'Boolean expression' must not be null!");
Assert.notNull(booleanExpression, "'Boolean expression' must not be null");
this.condition = booleanExpression;
return this;
@ -901,7 +901,7 @@ public class ConditionalOperators { @@ -901,7 +901,7 @@ public class ConditionalOperators {
@Override
public ThenBuilder when(CriteriaDefinition criteria) {
Assert.notNull(criteria, "Criteria must not be null!");
Assert.notNull(criteria, "Criteria must not be null");
this.condition = criteria;
return this;
}
@ -909,7 +909,7 @@ public class ConditionalOperators { @@ -909,7 +909,7 @@ public class ConditionalOperators {
@Override
public ThenBuilder when(AggregationExpression expression) {
Assert.notNull(expression, "AggregationExpression field must not be null!");
Assert.notNull(expression, "AggregationExpression field must not be null");
this.condition = expression;
return this;
}
@ -917,7 +917,7 @@ public class ConditionalOperators { @@ -917,7 +917,7 @@ public class ConditionalOperators {
@Override
public ThenBuilder when(String booleanField) {
Assert.hasText(booleanField, "Boolean field name must not be null or empty!");
Assert.hasText(booleanField, "Boolean field name must not be null or empty");
this.condition = Fields.field(booleanField);
return this;
}
@ -925,7 +925,7 @@ public class ConditionalOperators { @@ -925,7 +925,7 @@ public class ConditionalOperators {
@Override
public OtherwiseBuilder then(Object thenValue) {
Assert.notNull(thenValue, "Then-value must not be null!");
Assert.notNull(thenValue, "Then-value must not be null");
this.thenValue = thenValue;
return this;
}
@ -933,7 +933,7 @@ public class ConditionalOperators { @@ -933,7 +933,7 @@ public class ConditionalOperators {
@Override
public OtherwiseBuilder thenValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
this.thenValue = Fields.field(fieldReference);
return this;
}
@ -941,7 +941,7 @@ public class ConditionalOperators { @@ -941,7 +941,7 @@ public class ConditionalOperators {
@Override
public OtherwiseBuilder thenValueOf(AggregationExpression expression) {
Assert.notNull(expression, "AggregationExpression must not be null!");
Assert.notNull(expression, "AggregationExpression must not be null");
this.thenValue = expression;
return this;
}
@ -949,21 +949,21 @@ public class ConditionalOperators { @@ -949,21 +949,21 @@ public class ConditionalOperators {
@Override
public Cond otherwise(Object otherwiseValue) {
Assert.notNull(otherwiseValue, "Value must not be null!");
Assert.notNull(otherwiseValue, "Value must not be null");
return new Cond(condition, thenValue, otherwiseValue);
}
@Override
public Cond otherwiseValueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Cond(condition, thenValue, Fields.field(fieldReference));
}
@Override
public Cond otherwiseValueOf(AggregationExpression expression) {
Assert.notNull(expression, "AggregationExpression must not be null!");
Assert.notNull(expression, "AggregationExpression must not be null");
return new Cond(condition, thenValue, expression);
}
}

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java

@ -64,7 +64,7 @@ public class ConvertOperators { @@ -64,7 +64,7 @@ public class ConvertOperators {
*/
public ConvertOperatorFactory(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
this.fieldReference = fieldReference;
this.expression = null;
@ -77,7 +77,7 @@ public class ConvertOperators { @@ -77,7 +77,7 @@ public class ConvertOperators {
*/
public ConvertOperatorFactory(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
this.fieldReference = null;
this.expression = expression;

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/CountOperation.java

@ -39,7 +39,7 @@ public class CountOperation implements FieldsExposingAggregationOperation { @@ -39,7 +39,7 @@ public class CountOperation implements FieldsExposingAggregationOperation {
*/
public CountOperation(String fieldName) {
Assert.hasText(fieldName, "Field name must not be null or empty!");
Assert.hasText(fieldName, "Field name must not be null or empty");
this.fieldName = fieldName;
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DataTypeOperators.java

@ -60,7 +60,7 @@ public class DataTypeOperators { @@ -60,7 +60,7 @@ public class DataTypeOperators {
*/
public static Type typeOf(String field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
return new Type(Fields.field(field));
}
}

158
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DateOperators.java

@ -48,7 +48,7 @@ public class DateOperators { @@ -48,7 +48,7 @@ public class DateOperators {
*/
public static DateOperatorFactory dateOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new DateOperatorFactory(fieldReference);
}
@ -61,7 +61,7 @@ public class DateOperators { @@ -61,7 +61,7 @@ public class DateOperators {
*/
public static DateOperatorFactory zonedDateOf(String fieldReference, Timezone timezone) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new DateOperatorFactory(fieldReference).withTimezone(timezone);
}
@ -73,7 +73,7 @@ public class DateOperators { @@ -73,7 +73,7 @@ public class DateOperators {
*/
public static DateOperatorFactory dateOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new DateOperatorFactory(expression);
}
@ -86,7 +86,7 @@ public class DateOperators { @@ -86,7 +86,7 @@ public class DateOperators {
*/
public static DateOperatorFactory zonedDateOf(AggregationExpression expression, Timezone timezone) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new DateOperatorFactory(expression).withTimezone(timezone);
}
@ -109,7 +109,7 @@ public class DateOperators { @@ -109,7 +109,7 @@ public class DateOperators {
*/
public static DateOperatorFactory dateValue(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new DateOperatorFactory(value);
}
@ -194,7 +194,7 @@ public class DateOperators { @@ -194,7 +194,7 @@ public class DateOperators {
*/
public static Timezone valueOf(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Timezone(value);
}
@ -207,7 +207,7 @@ public class DateOperators { @@ -207,7 +207,7 @@ public class DateOperators {
*/
public static Timezone fromOffset(TimeZone timeZone) {
Assert.notNull(timeZone, "TimeZone must not be null!");
Assert.notNull(timeZone, "TimeZone must not be null");
return fromOffset(
ZoneOffset.ofTotalSeconds(Math.toIntExact(TimeUnit.MILLISECONDS.toSeconds(timeZone.getRawOffset()))));
@ -222,7 +222,7 @@ public class DateOperators { @@ -222,7 +222,7 @@ public class DateOperators {
*/
public static Timezone fromOffset(ZoneOffset offset) {
Assert.notNull(offset, "ZoneOffset must not be null!");
Assert.notNull(offset, "ZoneOffset must not be null");
return new Timezone(offset.toString());
}
@ -235,7 +235,7 @@ public class DateOperators { @@ -235,7 +235,7 @@ public class DateOperators {
*/
public static Timezone fromZone(TimeZone timeZone) {
Assert.notNull(timeZone, "TimeZone must not be null!");
Assert.notNull(timeZone, "TimeZone must not be null");
return valueOf(timeZone.getID());
}
@ -249,7 +249,7 @@ public class DateOperators { @@ -249,7 +249,7 @@ public class DateOperators {
*/
public static Timezone fromZone(ZoneId zoneId) {
Assert.notNull(zoneId, "ZoneId must not be null!");
Assert.notNull(zoneId, "ZoneId must not be null");
return new Timezone(zoneId.toString());
}
@ -316,7 +316,7 @@ public class DateOperators { @@ -316,7 +316,7 @@ public class DateOperators {
this(fieldReference, null, null, Timezone.none());
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
}
/**
@ -328,7 +328,7 @@ public class DateOperators { @@ -328,7 +328,7 @@ public class DateOperators {
this(null, expression, null, Timezone.none());
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
}
/**
@ -348,7 +348,7 @@ public class DateOperators { @@ -348,7 +348,7 @@ public class DateOperators {
this(null, null, value, Timezone.none());
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
}
/**
@ -362,7 +362,7 @@ public class DateOperators { @@ -362,7 +362,7 @@ public class DateOperators {
*/
public DateOperatorFactory withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null!");
Assert.notNull(timezone, "Timezone must not be null");
return new DateOperatorFactory(fieldReference, expression, dateValue, timezone);
}
@ -811,7 +811,7 @@ public class DateOperators { @@ -811,7 +811,7 @@ public class DateOperators {
*/
public DateFromPartsOperatorFactory withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null!");
Assert.notNull(timezone, "Timezone must not be null");
return new DateFromPartsOperatorFactory(timezone);
}
}
@ -893,7 +893,7 @@ public class DateOperators { @@ -893,7 +893,7 @@ public class DateOperators {
*/
public static DayOfYear dayOfYear(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new DayOfYear(value);
}
@ -905,7 +905,7 @@ public class DateOperators { @@ -905,7 +905,7 @@ public class DateOperators {
*/
public static DayOfYear dayOfYear(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return dayOfYear(Fields.field(fieldReference));
}
@ -917,7 +917,7 @@ public class DateOperators { @@ -917,7 +917,7 @@ public class DateOperators {
*/
public static DayOfYear dayOfYear(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return dayOfYear((Object) expression);
}
@ -933,7 +933,7 @@ public class DateOperators { @@ -933,7 +933,7 @@ public class DateOperators {
@Override
public DayOfYear withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new DayOfYear(appendTimezone(values().iterator().next(), timezone));
}
@ -965,7 +965,7 @@ public class DateOperators { @@ -965,7 +965,7 @@ public class DateOperators {
*/
public static DayOfMonth dayOfMonth(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new DayOfMonth(value);
}
@ -977,7 +977,7 @@ public class DateOperators { @@ -977,7 +977,7 @@ public class DateOperators {
*/
public static DayOfMonth dayOfMonth(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return dayOfMonth(Fields.field(fieldReference));
}
@ -989,7 +989,7 @@ public class DateOperators { @@ -989,7 +989,7 @@ public class DateOperators {
*/
public static DayOfMonth dayOfMonth(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return dayOfMonth((Object) expression);
}
@ -1005,7 +1005,7 @@ public class DateOperators { @@ -1005,7 +1005,7 @@ public class DateOperators {
@Override
public DayOfMonth withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new DayOfMonth(appendTimezone(values().iterator().next(), timezone));
}
@ -1037,7 +1037,7 @@ public class DateOperators { @@ -1037,7 +1037,7 @@ public class DateOperators {
*/
public static DayOfWeek dayOfWeek(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new DayOfWeek(value);
}
@ -1049,7 +1049,7 @@ public class DateOperators { @@ -1049,7 +1049,7 @@ public class DateOperators {
*/
public static DayOfWeek dayOfWeek(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return dayOfWeek(Fields.field(fieldReference));
}
@ -1061,7 +1061,7 @@ public class DateOperators { @@ -1061,7 +1061,7 @@ public class DateOperators {
*/
public static DayOfWeek dayOfWeek(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return dayOfWeek((Object) expression);
}
@ -1077,7 +1077,7 @@ public class DateOperators { @@ -1077,7 +1077,7 @@ public class DateOperators {
@Override
public DayOfWeek withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new DayOfWeek(appendTimezone(values().iterator().next(), timezone));
}
@ -1109,7 +1109,7 @@ public class DateOperators { @@ -1109,7 +1109,7 @@ public class DateOperators {
*/
public static Year year(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new Year(value);
}
@ -1121,7 +1121,7 @@ public class DateOperators { @@ -1121,7 +1121,7 @@ public class DateOperators {
*/
public static Year yearOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return year(Fields.field(fieldReference));
}
@ -1133,7 +1133,7 @@ public class DateOperators { @@ -1133,7 +1133,7 @@ public class DateOperators {
*/
public static Year yearOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return year(expression);
}
@ -1149,7 +1149,7 @@ public class DateOperators { @@ -1149,7 +1149,7 @@ public class DateOperators {
@Override
public Year withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new Year(appendTimezone(values().iterator().next(), timezone));
}
@ -1181,7 +1181,7 @@ public class DateOperators { @@ -1181,7 +1181,7 @@ public class DateOperators {
*/
public static Month month(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new Month(value);
}
@ -1193,7 +1193,7 @@ public class DateOperators { @@ -1193,7 +1193,7 @@ public class DateOperators {
*/
public static Month monthOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return month(Fields.field(fieldReference));
}
@ -1205,7 +1205,7 @@ public class DateOperators { @@ -1205,7 +1205,7 @@ public class DateOperators {
*/
public static Month monthOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return month(expression);
}
@ -1221,7 +1221,7 @@ public class DateOperators { @@ -1221,7 +1221,7 @@ public class DateOperators {
@Override
public Month withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new Month(appendTimezone(values().iterator().next(), timezone));
}
@ -1253,7 +1253,7 @@ public class DateOperators { @@ -1253,7 +1253,7 @@ public class DateOperators {
*/
public static Week week(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new Week(value);
}
@ -1265,7 +1265,7 @@ public class DateOperators { @@ -1265,7 +1265,7 @@ public class DateOperators {
*/
public static Week weekOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return week(Fields.field(fieldReference));
}
@ -1277,7 +1277,7 @@ public class DateOperators { @@ -1277,7 +1277,7 @@ public class DateOperators {
*/
public static Week weekOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return week(expression);
}
@ -1293,7 +1293,7 @@ public class DateOperators { @@ -1293,7 +1293,7 @@ public class DateOperators {
@Override
public Week withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new Week(appendTimezone(values().iterator().next(), timezone));
}
@ -1325,7 +1325,7 @@ public class DateOperators { @@ -1325,7 +1325,7 @@ public class DateOperators {
*/
public static Hour hour(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new Hour(value);
}
@ -1337,7 +1337,7 @@ public class DateOperators { @@ -1337,7 +1337,7 @@ public class DateOperators {
*/
public static Hour hourOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return hour(Fields.field(fieldReference));
}
@ -1349,7 +1349,7 @@ public class DateOperators { @@ -1349,7 +1349,7 @@ public class DateOperators {
*/
public static Hour hourOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return hour(expression);
}
@ -1365,7 +1365,7 @@ public class DateOperators { @@ -1365,7 +1365,7 @@ public class DateOperators {
@Override
public Hour withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new Hour(appendTimezone(values().iterator().next(), timezone));
}
@ -1397,7 +1397,7 @@ public class DateOperators { @@ -1397,7 +1397,7 @@ public class DateOperators {
*/
public static Minute minute(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new Minute(value);
}
@ -1409,7 +1409,7 @@ public class DateOperators { @@ -1409,7 +1409,7 @@ public class DateOperators {
*/
public static Minute minuteOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return minute(Fields.field(fieldReference));
}
@ -1421,7 +1421,7 @@ public class DateOperators { @@ -1421,7 +1421,7 @@ public class DateOperators {
*/
public static Minute minuteOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return minute(expression);
}
@ -1437,7 +1437,7 @@ public class DateOperators { @@ -1437,7 +1437,7 @@ public class DateOperators {
@Override
public Minute withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new Minute(appendTimezone(values().iterator().next(), timezone));
}
@ -1469,7 +1469,7 @@ public class DateOperators { @@ -1469,7 +1469,7 @@ public class DateOperators {
*/
public static Second second(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new Second(value);
}
@ -1481,7 +1481,7 @@ public class DateOperators { @@ -1481,7 +1481,7 @@ public class DateOperators {
*/
public static Second secondOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return second(Fields.field(fieldReference));
}
@ -1493,7 +1493,7 @@ public class DateOperators { @@ -1493,7 +1493,7 @@ public class DateOperators {
*/
public static Second secondOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return second(expression);
}
@ -1509,7 +1509,7 @@ public class DateOperators { @@ -1509,7 +1509,7 @@ public class DateOperators {
@Override
public Second withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new Second(appendTimezone(values().iterator().next(), timezone));
}
@ -1541,7 +1541,7 @@ public class DateOperators { @@ -1541,7 +1541,7 @@ public class DateOperators {
*/
public static Millisecond millisecond(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new Millisecond(value);
}
@ -1553,7 +1553,7 @@ public class DateOperators { @@ -1553,7 +1553,7 @@ public class DateOperators {
*/
public static Millisecond millisecondOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return millisecond(Fields.field(fieldReference));
}
@ -1565,7 +1565,7 @@ public class DateOperators { @@ -1565,7 +1565,7 @@ public class DateOperators {
*/
public static Millisecond millisecondOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return millisecond(expression);
}
@ -1581,7 +1581,7 @@ public class DateOperators { @@ -1581,7 +1581,7 @@ public class DateOperators {
@Override
public Millisecond withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new Millisecond(appendTimezone(values().iterator().next(), timezone));
}
@ -1613,14 +1613,14 @@ public class DateOperators { @@ -1613,14 +1613,14 @@ public class DateOperators {
*/
public static FormatBuilder dateToString(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new FormatBuilder() {
@Override
public DateToString toString(String format) {
Assert.notNull(format, "Format must not be null!");
Assert.notNull(format, "Format must not be null");
return new DateToString(argumentMap(value, format, Timezone.none()));
}
@ -1639,7 +1639,7 @@ public class DateOperators { @@ -1639,7 +1639,7 @@ public class DateOperators {
*/
public static FormatBuilder dateOf(final String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return dateToString(Fields.field(fieldReference));
}
@ -1651,7 +1651,7 @@ public class DateOperators { @@ -1651,7 +1651,7 @@ public class DateOperators {
*/
public static FormatBuilder dateOf(final AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return dateToString(expression);
}
@ -1667,7 +1667,7 @@ public class DateOperators { @@ -1667,7 +1667,7 @@ public class DateOperators {
@Override
public DateToString withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new DateToString(append("timezone", timezone));
}
@ -1790,7 +1790,7 @@ public class DateOperators { @@ -1790,7 +1790,7 @@ public class DateOperators {
*/
public static IsoDayOfWeek isoDayWeek(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new IsoDayOfWeek(value);
}
@ -1802,7 +1802,7 @@ public class DateOperators { @@ -1802,7 +1802,7 @@ public class DateOperators {
*/
public static IsoDayOfWeek isoDayOfWeek(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return isoDayWeek(Fields.field(fieldReference));
}
@ -1814,7 +1814,7 @@ public class DateOperators { @@ -1814,7 +1814,7 @@ public class DateOperators {
*/
public static IsoDayOfWeek isoDayOfWeek(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return isoDayWeek(expression);
}
@ -1830,7 +1830,7 @@ public class DateOperators { @@ -1830,7 +1830,7 @@ public class DateOperators {
@Override
public IsoDayOfWeek withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new IsoDayOfWeek(appendTimezone(values().iterator().next(), timezone));
}
@ -1862,7 +1862,7 @@ public class DateOperators { @@ -1862,7 +1862,7 @@ public class DateOperators {
*/
public static IsoWeek isoWeek(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new IsoWeek(value);
}
@ -1874,7 +1874,7 @@ public class DateOperators { @@ -1874,7 +1874,7 @@ public class DateOperators {
*/
public static IsoWeek isoWeekOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return isoWeek(Fields.field(fieldReference));
}
@ -1886,7 +1886,7 @@ public class DateOperators { @@ -1886,7 +1886,7 @@ public class DateOperators {
*/
public static IsoWeek isoWeekOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return isoWeek(expression);
}
@ -1902,7 +1902,7 @@ public class DateOperators { @@ -1902,7 +1902,7 @@ public class DateOperators {
@Override
public IsoWeek withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new IsoWeek(appendTimezone(values().iterator().next(), timezone));
}
@ -1934,7 +1934,7 @@ public class DateOperators { @@ -1934,7 +1934,7 @@ public class DateOperators {
*/
public static IsoWeekYear isoWeekYear(Object value) {
Assert.notNull(value, "value must not be null!");
Assert.notNull(value, "value must not be null");
return new IsoWeekYear(value);
}
@ -1946,7 +1946,7 @@ public class DateOperators { @@ -1946,7 +1946,7 @@ public class DateOperators {
*/
public static IsoWeekYear isoWeekYearOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return isoWeekYear(Fields.field(fieldReference));
}
@ -1958,7 +1958,7 @@ public class DateOperators { @@ -1958,7 +1958,7 @@ public class DateOperators {
*/
public static IsoWeekYear isoWeekYearOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return isoWeekYear(expression);
}
@ -1974,7 +1974,7 @@ public class DateOperators { @@ -1974,7 +1974,7 @@ public class DateOperators {
@Override
public IsoWeekYear withTimezone(Timezone timezone) {
Assert.notNull(timezone, "Timezone must not be null.");
Assert.notNull(timezone, "Timezone must not be null");
return new IsoWeekYear(appendTimezone(values().iterator().next(), timezone));
}
@ -2278,7 +2278,7 @@ public class DateOperators { @@ -2278,7 +2278,7 @@ public class DateOperators {
*/
default DateFromParts yearOf(String fieldReference) {
Assert.hasText(fieldReference, "Field reference must not be null nor empty.");
Assert.hasText(fieldReference, "Field reference must not be null nor empty");
return year(Fields.field(fieldReference));
}
@ -2291,7 +2291,7 @@ public class DateOperators { @@ -2291,7 +2291,7 @@ public class DateOperators {
*/
default DateFromParts yearOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return year(expression);
}
}
@ -2454,7 +2454,7 @@ public class DateOperators { @@ -2454,7 +2454,7 @@ public class DateOperators {
*/
default IsoDateFromParts isoWeekYearOf(String fieldReference) {
Assert.hasText(fieldReference, "Field reference must not be null nor empty.");
Assert.hasText(fieldReference, "Field reference must not be null nor empty");
return isoWeekYear(Fields.field(fieldReference));
}
@ -2467,7 +2467,7 @@ public class DateOperators { @@ -2467,7 +2467,7 @@ public class DateOperators {
*/
default IsoDateFromParts isoWeekYearOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return isoWeekYear(expression);
}
}
@ -2498,7 +2498,7 @@ public class DateOperators { @@ -2498,7 +2498,7 @@ public class DateOperators {
*/
public static DateToParts dateToParts(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new DateToParts(Collections.singletonMap("date", value));
}
@ -2511,7 +2511,7 @@ public class DateOperators { @@ -2511,7 +2511,7 @@ public class DateOperators {
*/
public static DateToParts datePartsOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return dateToParts(Fields.field(fieldReference));
}
@ -2626,7 +2626,7 @@ public class DateOperators { @@ -2626,7 +2626,7 @@ public class DateOperators {
*/
public DateFromString withFormat(String format) {
Assert.notNull(format, "Format must not be null!");
Assert.notNull(format, "Format must not be null");
return new DateFromString(append("format", format));
}

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DocumentEnhancingOperation.java

@ -93,7 +93,7 @@ abstract class DocumentEnhancingOperation implements InheritsFieldsAggregationOp @@ -93,7 +93,7 @@ abstract class DocumentEnhancingOperation implements InheritsFieldsAggregationOp
return exposedFields.and(new ExposedField(Fields.field((String) field), true));
}
throw new IllegalArgumentException(String.format("Expected %s to be a field/property.", field));
throw new IllegalArgumentException(String.format("Expected %s to be a field/property", field));
}
private static Document toSetEntry(Entry<Object, Object> entry, AggregationOperationContext context) {
@ -148,8 +148,8 @@ abstract class DocumentEnhancingOperation implements InheritsFieldsAggregationOp @@ -148,8 +148,8 @@ abstract class DocumentEnhancingOperation implements InheritsFieldsAggregationOp
*/
ExpressionProjection(String expression, Object[] parameters) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(parameters, "Parameters must not be null!");
Assert.notNull(expression, "Expression must not be null");
Assert.notNull(parameters, "Parameters must not be null");
this.expression = expression;
this.params = parameters.clone();

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/EvaluationOperators.java

@ -60,7 +60,7 @@ public class EvaluationOperators { @@ -60,7 +60,7 @@ public class EvaluationOperators {
*/
public EvaluationOperatorFactory(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
this.fieldReference = fieldReference;
this.expression = null;
}
@ -72,7 +72,7 @@ public class EvaluationOperators { @@ -72,7 +72,7 @@ public class EvaluationOperators {
*/
public EvaluationOperatorFactory(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
this.fieldReference = null;
this.expression = expression;
}
@ -108,7 +108,7 @@ public class EvaluationOperators { @@ -108,7 +108,7 @@ public class EvaluationOperators {
*/
public static Expr valueOf(String fieldReference) {
Assert.notNull(fieldReference, "FieldReference must not be null!");
Assert.notNull(fieldReference, "FieldReference must not be null");
return new Expr(Fields.field(fieldReference));
}
@ -120,7 +120,7 @@ public class EvaluationOperators { @@ -120,7 +120,7 @@ public class EvaluationOperators {
*/
public static Expr valueOf(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return new Expr(expression);
}

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFields.java

@ -109,7 +109,7 @@ public final class ExposedFields implements Iterable<ExposedField> { @@ -109,7 +109,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
*/
private static ExposedFields createFields(Fields fields, boolean synthetic) {
Assert.notNull(fields, "Fields must not be null!");
Assert.notNull(fields, "Fields must not be null");
List<ExposedField> result = new ArrayList<ExposedField>();
for (Field field : fields) {
@ -139,7 +139,7 @@ public final class ExposedFields implements Iterable<ExposedField> { @@ -139,7 +139,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
*/
public ExposedFields and(ExposedField field) {
Assert.notNull(field, "Exposed field must not be null!");
Assert.notNull(field, "Exposed field must not be null");
ArrayList<ExposedField> result = new ArrayList<ExposedField>();
result.addAll(field.synthetic ? syntheticFields : originalFields);
@ -361,7 +361,7 @@ public final class ExposedFields implements Iterable<ExposedField> { @@ -361,7 +361,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
*/
public DirectFieldReference(ExposedField field) {
Assert.notNull(field, "ExposedField must not be null!");
Assert.notNull(field, "ExposedField must not be null");
this.field = field;
}

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFieldsAggregationOperationContext.java

@ -47,8 +47,8 @@ class ExposedFieldsAggregationOperationContext implements AggregationOperationCo @@ -47,8 +47,8 @@ class ExposedFieldsAggregationOperationContext implements AggregationOperationCo
public ExposedFieldsAggregationOperationContext(ExposedFields exposedFields,
AggregationOperationContext rootContext) {
Assert.notNull(exposedFields, "ExposedFields must not be null!");
Assert.notNull(rootContext, "RootContext must not be null!");
Assert.notNull(exposedFields, "ExposedFields must not be null");
Assert.notNull(rootContext, "RootContext must not be null");
this.exposedFields = exposedFields;
this.rootContext = rootContext;
@ -88,14 +88,14 @@ class ExposedFieldsAggregationOperationContext implements AggregationOperationCo @@ -88,14 +88,14 @@ class ExposedFieldsAggregationOperationContext implements AggregationOperationCo
*/
private FieldReference getReference(@Nullable Field field, String name) {
Assert.notNull(name, "Name must not be null!");
Assert.notNull(name, "Name must not be null");
FieldReference exposedField = resolveExposedField(field, name);
if (exposedField != null) {
return exposedField;
}
throw new IllegalArgumentException(String.format("Invalid reference '%s'!", name));
throw new IllegalArgumentException(String.format("Invalid reference '%s'", name));
}
/**

14
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/FacetOperation.java

@ -72,8 +72,8 @@ public class FacetOperation implements FieldsExposingAggregationOperation { @@ -72,8 +72,8 @@ public class FacetOperation implements FieldsExposingAggregationOperation {
*/
public FacetOperationBuilder and(AggregationOperation... operations) {
Assert.notNull(operations, "AggregationOperations must not be null!");
Assert.notEmpty(operations, "AggregationOperations must not be empty!");
Assert.notNull(operations, "AggregationOperations must not be null");
Assert.notEmpty(operations, "AggregationOperations must not be empty");
return new FacetOperationBuilder(facets, Arrays.asList(operations));
}
@ -118,7 +118,7 @@ public class FacetOperation implements FieldsExposingAggregationOperation { @@ -118,7 +118,7 @@ public class FacetOperation implements FieldsExposingAggregationOperation {
*/
public FacetOperation as(String fieldName) {
Assert.hasText(fieldName, "FieldName must not be null or empty!");
Assert.hasText(fieldName, "FieldName must not be null or empty");
return new FacetOperation(current.and(fieldName, operations));
}
@ -178,8 +178,8 @@ public class FacetOperation implements FieldsExposingAggregationOperation { @@ -178,8 +178,8 @@ public class FacetOperation implements FieldsExposingAggregationOperation {
*/
Facets and(String fieldName, List<AggregationOperation> operations) {
Assert.hasText(fieldName, "FieldName must not be null or empty!");
Assert.notNull(operations, "AggregationOperations must not be null!");
Assert.hasText(fieldName, "FieldName must not be null or empty");
Assert.notNull(operations, "AggregationOperations must not be null");
List<Facet> facets = new ArrayList<Facet>(this.facets.size() + 1);
facets.addAll(this.facets);
@ -207,8 +207,8 @@ public class FacetOperation implements FieldsExposingAggregationOperation { @@ -207,8 +207,8 @@ public class FacetOperation implements FieldsExposingAggregationOperation {
*/
Facet(ExposedField exposedField, List<AggregationOperation> operations) {
Assert.notNull(exposedField, "ExposedField must not be null!");
Assert.notNull(operations, "AggregationOperations must not be null!");
Assert.notNull(exposedField, "ExposedField must not be null");
Assert.notNull(operations, "AggregationOperations must not be null");
this.exposedField = exposedField;
this.operations = operations;

14
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Fields.java

@ -37,8 +37,8 @@ import org.springframework.util.StringUtils; @@ -37,8 +37,8 @@ import org.springframework.util.StringUtils;
*/
public final class Fields implements Iterable<Field> {
private static final String AMBIGUOUS_EXCEPTION = "Found two fields both using '%s' as name: %s and %s! Please "
+ "customize your field definitions to get to unique field names!";
private static final String AMBIGUOUS_EXCEPTION = "Found two fields both using '%s' as name: %s and %s; Please "
+ "customize your field definitions to get to unique field names";
public static final String UNDERSCORE_ID = "_id";
public static final String UNDERSCORE_ID_REF = "$_id";
@ -53,7 +53,7 @@ public final class Fields implements Iterable<Field> { @@ -53,7 +53,7 @@ public final class Fields implements Iterable<Field> {
*/
public static Fields from(Field... fields) {
Assert.notNull(fields, "Fields must not be null!");
Assert.notNull(fields, "Fields must not be null");
return new Fields(Arrays.asList(fields));
}
@ -65,7 +65,7 @@ public final class Fields implements Iterable<Field> { @@ -65,7 +65,7 @@ public final class Fields implements Iterable<Field> {
*/
public static Fields fields(String... names) {
Assert.notNull(names, "Field names must not be null!");
Assert.notNull(names, "Field names must not be null");
List<Field> fields = new ArrayList<Field>();
@ -96,7 +96,7 @@ public final class Fields implements Iterable<Field> { @@ -96,7 +96,7 @@ public final class Fields implements Iterable<Field> {
* @return
*/
public static Field field(String name, String target) {
Assert.hasText(target, "Target must not be null or empty!");
Assert.hasText(target, "Target must not be null or empty");
return new AggregationField(name, target);
}
@ -107,7 +107,7 @@ public final class Fields implements Iterable<Field> { @@ -107,7 +107,7 @@ public final class Fields implements Iterable<Field> {
*/
private Fields(List<Field> fields) {
Assert.notNull(fields, "Fields must not be null!");
Assert.notNull(fields, "Fields must not be null");
this.fields = verify(fields);
}
@ -228,7 +228,7 @@ public final class Fields implements Iterable<Field> { @@ -228,7 +228,7 @@ public final class Fields implements Iterable<Field> {
String nameToSet = name != null ? cleanUp(name) : null;
String targetToSet = target != null ? cleanUp(target) : null;
Assert.hasText(nameToSet, "AggregationField name must not be null or empty!");
Assert.hasText(nameToSet, "AggregationField name must not be null or empty");
if (target == null && name.contains(".")) {
this.name = nameToSet.substring(nameToSet.indexOf('.') + 1);

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GeoNearOperation.java

@ -64,8 +64,8 @@ public class GeoNearOperation implements AggregationOperation { @@ -64,8 +64,8 @@ public class GeoNearOperation implements AggregationOperation {
*/
private GeoNearOperation(NearQuery nearQuery, String distanceField, @Nullable String indexKey) {
Assert.notNull(nearQuery, "NearQuery must not be null.");
Assert.hasLength(distanceField, "Distance field must not be null or empty.");
Assert.notNull(nearQuery, "NearQuery must not be null");
Assert.hasLength(distanceField, "Distance field must not be null or empty");
this.nearQuery = nearQuery;
this.distanceField = distanceField;

26
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GraphLookupOperation.java

@ -225,7 +225,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -225,7 +225,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@Override
public StartWithBuilder from(String collectionName) {
Assert.hasText(collectionName, "CollectionName must not be null or empty!");
Assert.hasText(collectionName, "CollectionName must not be null or empty");
this.from = collectionName;
return this;
@ -234,8 +234,8 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -234,8 +234,8 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@Override
public ConnectFromBuilder startWith(String... fieldReferences) {
Assert.notNull(fieldReferences, "FieldReferences must not be null!");
Assert.noNullElements(fieldReferences, "FieldReferences must not contain null elements!");
Assert.notNull(fieldReferences, "FieldReferences must not be null");
Assert.noNullElements(fieldReferences, "FieldReferences must not contain null elements");
List<Object> fields = new ArrayList<Object>(fieldReferences.length);
@ -250,8 +250,8 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -250,8 +250,8 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@Override
public ConnectFromBuilder startWith(AggregationExpression... expressions) {
Assert.notNull(expressions, "AggregationExpressions must not be null!");
Assert.noNullElements(expressions, "AggregationExpressions must not contain null elements!");
Assert.notNull(expressions, "AggregationExpressions must not be null");
Assert.noNullElements(expressions, "AggregationExpressions must not contain null elements");
this.startWith = Arrays.asList(expressions);
return this;
@ -260,8 +260,8 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -260,8 +260,8 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@Override
public ConnectFromBuilder startWith(Object... expressions) {
Assert.notNull(expressions, "Expressions must not be null!");
Assert.noNullElements(expressions, "Expressions must not contain null elements!");
Assert.notNull(expressions, "Expressions must not be null");
Assert.noNullElements(expressions, "Expressions must not contain null elements");
this.startWith = verifyAndPotentiallyTransformStartsWithTypes(expressions);
return this;
@ -301,7 +301,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -301,7 +301,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@Override
public ConnectToBuilder connectFrom(String fieldName) {
Assert.hasText(fieldName, "ConnectFrom must not be null or empty!");
Assert.hasText(fieldName, "ConnectFrom must not be null or empty");
this.connectFrom = fieldName;
return this;
@ -310,7 +310,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -310,7 +310,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@Override
public GraphLookupOperationBuilder connectTo(String fieldName) {
Assert.hasText(fieldName, "ConnectTo must not be null or empty!");
Assert.hasText(fieldName, "ConnectTo must not be null or empty");
return new GraphLookupOperationBuilder(from, startWith, connectFrom, fieldName);
}
@ -346,7 +346,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -346,7 +346,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
*/
public GraphLookupOperationBuilder maxDepth(long numberOfRecursions) {
Assert.isTrue(numberOfRecursions >= 0, "Max depth must be >= 0!");
Assert.isTrue(numberOfRecursions >= 0, "Max depth must be >= 0");
this.maxDepth = numberOfRecursions;
return this;
@ -360,7 +360,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -360,7 +360,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
*/
public GraphLookupOperationBuilder depthField(String fieldName) {
Assert.hasText(fieldName, "Depth field name must not be null or empty!");
Assert.hasText(fieldName, "Depth field name must not be null or empty");
this.depthField = Fields.field(fieldName);
return this;
@ -374,7 +374,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -374,7 +374,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
*/
public GraphLookupOperationBuilder restrict(CriteriaDefinition criteriaDefinition) {
Assert.notNull(criteriaDefinition, "CriteriaDefinition must not be null!");
Assert.notNull(criteriaDefinition, "CriteriaDefinition must not be null");
this.restrictSearchWithMatch = criteriaDefinition;
return this;
@ -389,7 +389,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @@ -389,7 +389,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
*/
public GraphLookupOperation as(String fieldName) {
Assert.hasText(fieldName, "As field name must not be null or empty!");
Assert.hasText(fieldName, "As field name must not be null or empty");
return new GraphLookupOperation(from, startWith, connectFrom, connectTo, Fields.field(fieldName), maxDepth,
depthField, restrictSearchWithMatch);

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GroupOperation.java

@ -80,8 +80,8 @@ public class GroupOperation implements FieldsExposingAggregationOperation { @@ -80,8 +80,8 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
*/
private GroupOperation(GroupOperation groupOperation, List<Operation> nextOperations) {
Assert.notNull(groupOperation, "GroupOperation must not be null!");
Assert.notNull(nextOperations, "NextOperations must not be null!");
Assert.notNull(groupOperation, "GroupOperation must not be null");
Assert.notNull(nextOperations, "NextOperations must not be null");
this.idFields = groupOperation.idFields;
this.operations = new ArrayList<Operation>(nextOperations.size() + 1);
@ -117,8 +117,8 @@ public class GroupOperation implements FieldsExposingAggregationOperation { @@ -117,8 +117,8 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
*/
private GroupOperationBuilder(GroupOperation groupOperation, Operation operation) {
Assert.notNull(groupOperation, "GroupOperation must not be null!");
Assert.notNull(operation, "Operation must not be null!");
Assert.notNull(groupOperation, "GroupOperation must not be null");
Assert.notNull(operation, "Operation must not be null");
this.groupOperation = groupOperation;
this.operation = operation;
@ -168,7 +168,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation { @@ -168,7 +168,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
*/
public GroupOperationBuilder sum(AggregationExpression expr) {
Assert.notNull(expr, "Expr must not be null!");
Assert.notNull(expr, "Expr must not be null");
return newBuilder(GroupOps.SUM, null, expr);
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LimitOperation.java

@ -39,7 +39,7 @@ public class LimitOperation implements AggregationOperation { @@ -39,7 +39,7 @@ public class LimitOperation implements AggregationOperation {
*/
public LimitOperation(long maxElements) {
Assert.isTrue(maxElements >= 0, "Maximum number of elements must be greater or equal to zero!");
Assert.isTrue(maxElements >= 0, "Maximum number of elements must be greater or equal to zero");
this.maxElements = maxElements;
}

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LiteralOperators.java

@ -33,7 +33,7 @@ public class LiteralOperators { @@ -33,7 +33,7 @@ public class LiteralOperators {
*/
public static LiteralOperatorFactory valueOf(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new LiteralOperatorFactory(value);
}
@ -51,7 +51,7 @@ public class LiteralOperators { @@ -51,7 +51,7 @@ public class LiteralOperators {
*/
public LiteralOperatorFactory(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
this.value = value;
}
@ -89,7 +89,7 @@ public class LiteralOperators { @@ -89,7 +89,7 @@ public class LiteralOperators {
*/
public static Literal asLiteral(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new Literal(value);
}
}

16
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LookupOperation.java

@ -49,10 +49,10 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe @@ -49,10 +49,10 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
*/
public LookupOperation(Field from, Field localField, Field foreignField, Field as) {
Assert.notNull(from, "From must not be null!");
Assert.notNull(localField, "LocalField must not be null!");
Assert.notNull(foreignField, "ForeignField must not be null!");
Assert.notNull(as, "As must not be null!");
Assert.notNull(from, "From must not be null");
Assert.notNull(localField, "LocalField must not be null");
Assert.notNull(foreignField, "ForeignField must not be null");
Assert.notNull(as, "As must not be null");
this.from = from;
this.localField = localField;
@ -155,7 +155,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe @@ -155,7 +155,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
@Override
public LocalFieldBuilder from(String name) {
Assert.hasText(name, "'From' must not be null or empty!");
Assert.hasText(name, "'From' must not be null or empty");
from = Fields.field(name);
return this;
}
@ -163,7 +163,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe @@ -163,7 +163,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
@Override
public LookupOperation as(String name) {
Assert.hasText(name, "'As' must not be null or empty!");
Assert.hasText(name, "'As' must not be null or empty");
as = new ExposedField(Fields.field(name), true);
return new LookupOperation(from, localField, foreignField, as);
}
@ -171,7 +171,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe @@ -171,7 +171,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
@Override
public AsBuilder foreignField(String name) {
Assert.hasText(name, "'ForeignField' must not be null or empty!");
Assert.hasText(name, "'ForeignField' must not be null or empty");
foreignField = Fields.field(name);
return this;
}
@ -179,7 +179,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe @@ -179,7 +179,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
@Override
public ForeignFieldBuilder localField(String name) {
Assert.hasText(name, "'LocalField' must not be null or empty!");
Assert.hasText(name, "'LocalField' must not be null or empty");
localField = Fields.field(name);
return this;
}

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MatchOperation.java

@ -47,7 +47,7 @@ public class MatchOperation implements AggregationOperation { @@ -47,7 +47,7 @@ public class MatchOperation implements AggregationOperation {
*/
public MatchOperation(CriteriaDefinition criteriaDefinition) {
Assert.notNull(criteriaDefinition, "Criteria must not be null!");
Assert.notNull(criteriaDefinition, "Criteria must not be null");
this.criteriaDefinition = criteriaDefinition;
this.expression = null;
@ -61,7 +61,7 @@ public class MatchOperation implements AggregationOperation { @@ -61,7 +61,7 @@ public class MatchOperation implements AggregationOperation {
*/
public MatchOperation(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
this.criteriaDefinition = null;
this.expression = expression;

12
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MergeOperation.java

@ -62,8 +62,8 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher @@ -62,8 +62,8 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher
public MergeOperation(MergeOperationTarget into, UniqueMergeId on, @Nullable Let let,
@Nullable WhenDocumentsMatch whenMatched, @Nullable WhenDocumentsDontMatch whenNotMatched) {
Assert.notNull(into, "Into must not be null! Please provide a target collection.");
Assert.notNull(on, "On must not be null! Use UniqueMergeId.id() instead.");
Assert.notNull(into, "Into must not be null Please provide a target collection");
Assert.notNull(on, "On must not be null Use UniqueMergeId.id() instead");
this.into = into;
this.on = on;
@ -167,7 +167,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher @@ -167,7 +167,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher
public static UniqueMergeId ofIdFields(String... fields) {
Assert.noNullElements(fields, "Fields must not contain null values!");
Assert.noNullElements(fields, "Fields must not contain null values");
if (ObjectUtils.isEmpty(fields)) {
return id();
@ -225,7 +225,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher @@ -225,7 +225,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher
private MergeOperationTarget(@Nullable String database, String collection) {
Assert.hasText(collection, "Collection must not be null nor empty!");
Assert.hasText(collection, "Collection must not be null nor empty");
this.database = database;
this.collection = collection;
@ -360,7 +360,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher @@ -360,7 +360,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher
private WhenDocumentsDontMatch(String value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
this.value = value;
}
@ -432,7 +432,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher @@ -432,7 +432,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher
*/
public MergeOperationBuilder intoCollection(String collection) {
Assert.hasText(collection, "Collection must not be null nor empty!");
Assert.hasText(collection, "Collection must not be null nor empty");
this.collection = collection;
return this;

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/NestedDelegatingExpressionAggregationOperationContext.java

@ -45,7 +45,7 @@ class NestedDelegatingExpressionAggregationOperationContext implements Aggregati @@ -45,7 +45,7 @@ class NestedDelegatingExpressionAggregationOperationContext implements Aggregati
NestedDelegatingExpressionAggregationOperationContext(AggregationOperationContext referenceContext,
Collection<Field> inners) {
Assert.notNull(referenceContext, "Reference context must not be null!");
Assert.notNull(referenceContext, "Reference context must not be null");
this.delegate = referenceContext;
this.inners = inners;
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ObjectOperators.java

@ -65,7 +65,7 @@ public class ObjectOperators { @@ -65,7 +65,7 @@ public class ObjectOperators {
*/
public ObjectOperatorFactory(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
this.value = value;
}

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/OutOperation.java

@ -57,7 +57,7 @@ public class OutOperation implements AggregationOperation { @@ -57,7 +57,7 @@ public class OutOperation implements AggregationOperation {
private OutOperation(@Nullable String databaseName, String collectionName, @Nullable Document uniqueKey,
@Nullable OutMode mode) {
Assert.notNull(collectionName, "Collection name must not be null!");
Assert.notNull(collectionName, "Collection name must not be null");
this.databaseName = databaseName;
this.collectionName = collectionName;
@ -128,7 +128,7 @@ public class OutOperation implements AggregationOperation { @@ -128,7 +128,7 @@ public class OutOperation implements AggregationOperation {
*/
public OutOperation uniqueKeyOf(Iterable<String> fields) {
Assert.notNull(fields, "Fields must not be null!");
Assert.notNull(fields, "Fields must not be null");
Document uniqueKey = new Document();
fields.forEach(it -> uniqueKey.append(it, 1));
@ -146,7 +146,7 @@ public class OutOperation implements AggregationOperation { @@ -146,7 +146,7 @@ public class OutOperation implements AggregationOperation {
*/
public OutOperation mode(OutMode mode) {
Assert.notNull(mode, "Mode must not be null!");
Assert.notNull(mode, "Mode must not be null");
return new OutOperation(databaseName, collectionName, uniqueKey, mode);
}
@ -193,7 +193,7 @@ public class OutOperation implements AggregationOperation { @@ -193,7 +193,7 @@ public class OutOperation implements AggregationOperation {
return new Document("$out", collectionName);
}
Assert.state(mode != null, "Mode must not be null!");
Assert.state(mode != null, "Mode must not be null");
Document $out = new Document("to", collectionName) //
.append("mode", mode.getMongoMode());

64
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java

@ -53,8 +53,8 @@ import org.springframework.util.Assert; @@ -53,8 +53,8 @@ import org.springframework.util.Assert;
public class ProjectionOperation implements FieldsExposingAggregationOperation {
private static final List<Projection> NONE = Collections.emptyList();
private static final String EXCLUSION_ERROR = "Exclusion of field %s not allowed. Projections by the mongodb "
+ "aggregation framework only support the exclusion of the %s field!";
private static final String EXCLUSION_ERROR = "Exclusion of field %s not allowed; Projections by the mongodb"
+ " aggregation framework only support the exclusion of the %s field";
private final List<Projection> projections;
@ -93,8 +93,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -93,8 +93,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
private ProjectionOperation(List<? extends Projection> current, List<? extends Projection> projections) {
Assert.notNull(current, "Current projections must not be null!");
Assert.notNull(projections, "Projections must not be null!");
Assert.notNull(current, "Current projections must not be null");
Assert.notNull(projections, "Projections must not be null");
this.projections = new ArrayList<ProjectionOperation.Projection>(current.size() + projections.size());
this.projections.addAll(current);
@ -275,8 +275,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -275,8 +275,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public AbstractProjectionOperationBuilder(Object value, ProjectionOperation operation) {
Assert.notNull(value, "value must not be null or empty!");
Assert.notNull(operation, "ProjectionOperation must not be null!");
Assert.notNull(value, "value must not be null or empty");
Assert.notNull(operation, "ProjectionOperation must not be null");
this.value = value;
this.operation = operation;
@ -390,8 +390,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -390,8 +390,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
super(field);
Assert.hasText(expression, "Expression must not be null!");
Assert.notNull(parameters, "Parameters must not be null!");
Assert.hasText(expression, "Expression must not be null");
Assert.notNull(parameters, "Parameters must not be null");
this.expression = expression;
this.params = parameters.clone();
@ -418,8 +418,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -418,8 +418,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public static class ProjectionOperationBuilder extends AbstractProjectionOperationBuilder {
private static final String NUMBER_NOT_NULL = "Number must not be null!";
private static final String FIELD_REFERENCE_NOT_NULL = "Field reference must not be null!";
private static final String NUMBER_NOT_NULL = "Number must not be null";
private static final String FIELD_REFERENCE_NOT_NULL = "Field reference must not be null";
private final @Nullable String name;
private final @Nullable OperationProjection previousProjection;
@ -502,14 +502,14 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -502,14 +502,14 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@Override
public ProjectionOperation applyCondition(Cond cond) {
Assert.notNull(cond, "ConditionalOperator must not be null!");
Assert.notNull(cond, "ConditionalOperator must not be null");
return this.operation.and(new ExpressionProjection(Fields.field(getRequiredName()), cond));
}
@Override
public ProjectionOperation applyCondition(IfNull ifNull) {
Assert.notNull(ifNull, "IfNullOperator must not be null!");
Assert.notNull(ifNull, "IfNullOperator must not be null");
return this.operation.and(new ExpressionProjection(Fields.field(getRequiredName()), ifNull));
}
@ -533,7 +533,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -533,7 +533,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder plus(String fieldReference) {
Assert.notNull(fieldReference, "Field reference must not be null!");
Assert.notNull(fieldReference, "Field reference must not be null");
return project("add", Fields.field(fieldReference));
}
@ -545,7 +545,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -545,7 +545,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder minus(Number number) {
Assert.notNull(number, "Number must not be null!");
Assert.notNull(number, "Number must not be null");
return project("subtract", number);
}
@ -572,7 +572,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -572,7 +572,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder minus(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return project("subtract", expression);
}
@ -611,7 +611,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -611,7 +611,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder multiply(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return project("multiply", expression);
}
@ -624,7 +624,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -624,7 +624,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
public ProjectionOperationBuilder divide(Number number) {
Assert.notNull(number, FIELD_REFERENCE_NOT_NULL);
Assert.isTrue(Math.abs(number.intValue()) != 0, "Number must not be zero!");
Assert.isTrue(Math.abs(number.intValue()) != 0, "Number must not be zero");
return project("divide", number);
}
@ -651,7 +651,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -651,7 +651,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder divide(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return project("divide", expression);
}
@ -665,7 +665,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -665,7 +665,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
public ProjectionOperationBuilder mod(Number number) {
Assert.notNull(number, NUMBER_NOT_NULL);
Assert.isTrue(Math.abs(number.intValue()) != 0, "Number must not be zero!");
Assert.isTrue(Math.abs(number.intValue()) != 0, "Number must not be zero");
return project("mod", number);
}
@ -692,7 +692,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -692,7 +692,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder mod(AggregationExpression expression) {
Assert.notNull(expression, "Expression must not be null!");
Assert.notNull(expression, "Expression must not be null");
return project("mod", expression);
}
@ -835,7 +835,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -835,7 +835,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder equalsArrays(String... arrays) {
Assert.notEmpty(arrays, "Arrays must not be null or empty!");
Assert.notEmpty(arrays, "Arrays must not be null or empty");
return project("setEquals", Fields.fields(arrays));
}
@ -849,7 +849,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -849,7 +849,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder intersectsArrays(String... arrays) {
Assert.notEmpty(arrays, "Arrays must not be null or empty!");
Assert.notEmpty(arrays, "Arrays must not be null or empty");
return project("setIntersection", Fields.fields(arrays));
}
@ -863,7 +863,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -863,7 +863,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder unionArrays(String... arrays) {
Assert.notEmpty(arrays, "Arrays must not be null or empty!");
Assert.notEmpty(arrays, "Arrays must not be null or empty");
return project("setUnion", Fields.fields(arrays));
}
@ -877,7 +877,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -877,7 +877,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder differenceToArray(String array) {
Assert.hasText(array, "Array must not be null or empty!");
Assert.hasText(array, "Array must not be null or empty");
return project("setDifference", Fields.fields(array));
}
@ -891,7 +891,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -891,7 +891,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ProjectionOperationBuilder subsetOfArray(String array) {
Assert.hasText(array, "Array must not be null or empty!");
Assert.hasText(array, "Array must not be null or empty");
return project("setIsSubset", Fields.fields(array));
}
@ -1270,7 +1270,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -1270,7 +1270,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
private String getRequiredName() {
Assert.state(name != null, "Projection field name must not be null!");
Assert.state(name != null, "Projection field name must not be null");
return name;
}
@ -1368,7 +1368,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -1368,7 +1368,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public static List<FieldProjection> from(Fields fields, @Nullable Object value) {
Assert.notNull(fields, "Fields must not be null!");
Assert.notNull(fields, "Fields must not be null");
List<FieldProjection> projections = new ArrayList<FieldProjection>();
for (Field field : fields) {
@ -1437,8 +1437,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -1437,8 +1437,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
super(field);
Assert.hasText(operation, "Operation must not be null or empty!");
Assert.notNull(values, "Values must not be null!");
Assert.hasText(operation, "Operation must not be null or empty");
Assert.notNull(values, "Values must not be null");
this.field = field;
this.operation = operation;
@ -1655,7 +1655,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -1655,7 +1655,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public Projection(Field field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
this.field = new ExposedField(field, true);
}
@ -1759,7 +1759,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -1759,7 +1759,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ArrayProjectionOperationBuilder and(AggregationExpression expression) {
Assert.notNull(expression, "AggregationExpression must not be null!");
Assert.notNull(expression, "AggregationExpression must not be null");
this.projections.add(expression);
return this;
@ -1773,7 +1773,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @@ -1773,7 +1773,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
*/
public ArrayProjectionOperationBuilder and(Field field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
this.projections.add(field);
return this;

4
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java

@ -63,7 +63,7 @@ public class RedactOperation implements AggregationOperation { @@ -63,7 +63,7 @@ public class RedactOperation implements AggregationOperation {
*/
public RedactOperation(AggregationExpression condition) {
Assert.notNull(condition, "Condition must not be null!");
Assert.notNull(condition, "Condition must not be null");
this.condition = condition;
}
@ -237,7 +237,7 @@ public class RedactOperation implements AggregationOperation { @@ -237,7 +237,7 @@ public class RedactOperation implements AggregationOperation {
}
throw new IllegalArgumentException(String.format(
"Invalid Condition. Expected CriteriaDefinition, AggregationExpression or Document but was %s.", when));
"Invalid Condition; Expected CriteriaDefinition, AggregationExpression or Document but was %s", when));
}
}
}

22
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceRootOperation.java

@ -66,7 +66,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -66,7 +66,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
*/
public ReplaceRootOperation(Replacement replacement) {
Assert.notNull(replacement, "Replacement must not be null!");
Assert.notNull(replacement, "Replacement must not be null");
this.replacement = replacement;
}
@ -152,7 +152,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -152,7 +152,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
*/
public ReplaceRootOperation withDocument(Document document) {
Assert.notNull(document, "Document must not be null!");
Assert.notNull(document, "Document must not be null");
return new ReplaceRootDocumentOperation().andValuesOf(document);
}
@ -240,8 +240,8 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -240,8 +240,8 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
protected ReplaceRootDocumentOperationBuilder(ReplaceRootDocumentOperation currentOperation, Object value) {
Assert.notNull(currentOperation, "Current ReplaceRootDocumentOperation must not be null!");
Assert.notNull(value, "Value must not be null!");
Assert.notNull(currentOperation, "Current ReplaceRootDocumentOperation must not be null");
Assert.notNull(value, "Value must not be null");
this.currentOperation = currentOperation;
this.value = value;
@ -287,7 +287,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -287,7 +287,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
protected AggregationExpressionReplacement(AggregationExpression aggregationExpression) {
Assert.notNull(aggregationExpression, "AggregationExpression must not be null!");
Assert.notNull(aggregationExpression, "AggregationExpression must not be null");
this.aggregationExpression = aggregationExpression;
}
@ -311,7 +311,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -311,7 +311,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
*/
protected FieldReplacement(Field field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
this.field = field;
}
@ -344,7 +344,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -344,7 +344,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
*/
protected ReplacementDocument(ReplacementContributor contributor) {
Assert.notNull(contributor, "ReplacementContributor must not be null!");
Assert.notNull(contributor, "ReplacementContributor must not be null");
replacements = Collections.singleton(contributor);
}
@ -452,7 +452,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -452,7 +452,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
*/
public DocumentContributor(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
this.value = value;
}
@ -482,7 +482,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -482,7 +482,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
*/
public FieldContributorSupport(Field field) {
Assert.notNull(field, "Field must not be null!");
Assert.notNull(field, "Field must not be null");
this.field = new ExposedField(field, true);
}
@ -514,7 +514,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -514,7 +514,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
super(field);
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
this.value = value;
}
@ -547,7 +547,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation @@ -547,7 +547,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
super(field);
Assert.notNull(aggregationExpression, "AggregationExpression must not be null!");
Assert.notNull(aggregationExpression, "AggregationExpression must not be null");
this.aggregationExpression = aggregationExpression;
}

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceWithOperation.java

@ -61,7 +61,7 @@ public class ReplaceWithOperation extends ReplaceRootOperation { @@ -61,7 +61,7 @@ public class ReplaceWithOperation extends ReplaceRootOperation {
*/
public static ReplaceWithOperation replaceWithValueOf(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
return new ReplaceWithOperation((ctx) -> {
Object target = value instanceof String ? Fields.field((String) value) : value;

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SampleOperation.java

@ -38,7 +38,7 @@ public class SampleOperation implements AggregationOperation { @@ -38,7 +38,7 @@ public class SampleOperation implements AggregationOperation {
*/
public SampleOperation(long sampleSize) {
Assert.isTrue(sampleSize > 0, "Sample size must be greater than zero!");
Assert.isTrue(sampleSize > 0, "Sample size must be greater than zero");
this.sampleSize = sampleSize;
}

8
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ScriptOperators.java

@ -99,7 +99,7 @@ public class ScriptOperators { @@ -99,7 +99,7 @@ public class ScriptOperators {
*/
public static Function function(String body) {
Assert.notNull(body, "Function body must not be null!");
Assert.notNull(body, "Function body must not be null");
Map<String, Object> function = new LinkedHashMap<>(2);
function.put(Fields.BODY.toString(), body);
@ -127,7 +127,7 @@ public class ScriptOperators { @@ -127,7 +127,7 @@ public class ScriptOperators {
*/
public Function args(List<Object> args) {
Assert.notNull(args, "Args must not be null! Use an empty list instead.");
Assert.notNull(args, "Args must not be null Use an empty list instead");
return new Function(appendAt(1, Fields.ARGS.toString(), args));
}
@ -140,7 +140,7 @@ public class ScriptOperators { @@ -140,7 +140,7 @@ public class ScriptOperators {
*/
public Function lang(String lang) {
Assert.hasText(lang, "Lang must not be null nor empty! The default would be 'js'.");
Assert.hasText(lang, "Lang must not be null nor empty; The default would be 'js'");
return new Function(appendAt(2, Fields.LANG.toString(), lang));
}
@ -528,7 +528,7 @@ public class ScriptOperators { @@ -528,7 +528,7 @@ public class ScriptOperators {
*/
public AccumulatorBuilder lang(String lang) {
Assert.hasText(lang, "Lang must not be null nor empty! The default would be 'js'.");
Assert.hasText(lang, "Lang must not be null nor empty; The default would be 'js'");
this.lang = lang;
return this;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save