committed by
Mark Paluch
parent
288e04b2d3
commit
37d99c4948
@@ -25,8 +25,10 @@ public class LazyLoadingException extends UncategorizedDataAccessException {
|
||||
private static final long serialVersionUID = -7089224903873220037L;
|
||||
|
||||
/**
|
||||
* @param msg
|
||||
* @param cause
|
||||
* Constructor for LazyLoadingException.
|
||||
*
|
||||
* @param msg the detail message.
|
||||
* @param cause the exception thrown by underlying data access API.
|
||||
*/
|
||||
public LazyLoadingException(String msg, Throwable cause) {
|
||||
super(msg, cause);
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface MongoDatabaseFactory extends CodecRegistryProvider, MongoSessio
|
||||
/**
|
||||
* Obtain a {@link MongoDatabase} instance to access the database with the given name.
|
||||
*
|
||||
* @param dbName
|
||||
* @param dbName must not be {@literal null}.
|
||||
* @return never {@literal null}.
|
||||
* @throws DataAccessException
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface MongoDbFactory extends MongoDatabaseFactory {
|
||||
/**
|
||||
* Creates a default {@link MongoDatabase} instance.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @throws DataAccessException
|
||||
* @deprecated since 3.0. Use {@link #getMongoDatabase()} instead.
|
||||
*/
|
||||
@@ -46,7 +46,7 @@ public interface MongoDbFactory extends MongoDatabaseFactory {
|
||||
* Obtain a {@link MongoDatabase} instance to access the database with the given name.
|
||||
*
|
||||
* @param dbName must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @throws DataAccessException
|
||||
* @deprecated since 3.0. Use {@link #getMongoDatabase(String)} instead.
|
||||
*/
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider {
|
||||
/**
|
||||
* Creates a default {@link MongoDatabase} instance.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @throws DataAccessException
|
||||
*/
|
||||
Mono<MongoDatabase> getMongoDatabase() throws DataAccessException;
|
||||
@@ -48,7 +48,7 @@ public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider {
|
||||
* Obtain a {@link MongoDatabase} instance to access the database with the given name.
|
||||
*
|
||||
* @param dbName must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @throws DataAccessException
|
||||
*/
|
||||
Mono<MongoDatabase> getMongoDatabase(String dbName) throws DataAccessException;
|
||||
|
||||
@@ -42,21 +42,21 @@ public @interface EnableMongoAuditing {
|
||||
/**
|
||||
* Configures the {@link AuditorAware} bean to be used to lookup the current principal.
|
||||
*
|
||||
* @return
|
||||
* @return empty {@link String} by default.
|
||||
*/
|
||||
String auditorAwareRef() default "";
|
||||
|
||||
/**
|
||||
* Configures whether the creation and modification dates are set. Defaults to {@literal true}.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal true} by default.
|
||||
*/
|
||||
boolean setDates() default true;
|
||||
|
||||
/**
|
||||
* Configures whether the entity shall be marked as modified on creation. Defaults to {@literal true}.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal true} by default.
|
||||
*/
|
||||
boolean modifyOnCreate() default true;
|
||||
|
||||
@@ -64,7 +64,7 @@ public @interface EnableMongoAuditing {
|
||||
* Configures a {@link DateTimeProvider} bean name that allows customizing the {@link org.joda.time.DateTime} to be
|
||||
* used for setting creation and modification dates.
|
||||
*
|
||||
* @return
|
||||
* @return empty {@link String} by default.
|
||||
*/
|
||||
String dateTimeProviderRef() default "";
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public abstract class MongoConfigurationSupport {
|
||||
/**
|
||||
* Register custom {@link Converter}s in a {@link CustomConversions} object if required. These
|
||||
* {@link CustomConversions} will be registered with the
|
||||
* {@link org.springframework.data.mongodb.core.convert.MappingMongoConverter} and {@link #mongoMappingContext()}.
|
||||
* {@link org.springframework.data.mongodb.core.convert.MappingMongoConverter} and {@link MongoMappingContext}.
|
||||
* Returns an empty {@link MongoCustomConversions} instance by default.
|
||||
* <p>
|
||||
* <strong>NOTE:</strong> Use {@link #configureConverters(MongoConverterConfigurationAdapter)} to configure MongoDB
|
||||
|
||||
@@ -94,7 +94,6 @@ public interface BulkOperations {
|
||||
* Add a list of updates to the bulk operation. For each update request, all matching documents are updated.
|
||||
*
|
||||
* @param updates Update operations to perform.
|
||||
* @return The bulk operation.
|
||||
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
|
||||
*/
|
||||
BulkOperations updateMulti(List<Pair<Query, Update>> updates);
|
||||
@@ -105,7 +104,6 @@ public interface BulkOperations {
|
||||
*
|
||||
* @param query Update criteria.
|
||||
* @param update Update operation to perform.
|
||||
* @return The bulk operation.
|
||||
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
|
||||
*/
|
||||
BulkOperations upsert(Query query, Update update);
|
||||
@@ -115,7 +113,6 @@ public interface BulkOperations {
|
||||
* else an insert.
|
||||
*
|
||||
* @param updates Updates/insert operations to perform.
|
||||
* @return The bulk operation.
|
||||
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
|
||||
*/
|
||||
BulkOperations upsert(List<Pair<Query, Update>> updates);
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.mongodb.client.MongoCollection;
|
||||
* @author Grame Rocher
|
||||
* @author Oliver Gierke
|
||||
* @author John Brisbin
|
||||
* @auhtor Christoph Strobl
|
||||
* @author Christoph Strobl
|
||||
* @since 1.0
|
||||
*/
|
||||
public interface CollectionCallback<T> {
|
||||
|
||||
@@ -95,7 +95,7 @@ public class CollectionOptions {
|
||||
|
||||
/**
|
||||
* Create new {@link CollectionOptions} with already given settings and capped set to {@literal true}. <br />
|
||||
* <strong>NOTE</strong> Using capped collections requires defining {@link #size(int)}.
|
||||
* <strong>NOTE</strong> Using capped collections requires defining {@link #size(long)}.
|
||||
*
|
||||
* @return new {@link CollectionOptions}.
|
||||
* @since 2.0
|
||||
|
||||
@@ -43,9 +43,10 @@ public interface CursorPreparer extends ReadPreferenceAware {
|
||||
/**
|
||||
* Prepare the given cursor (apply limits, skips and so on). Returns the prepared cursor.
|
||||
*
|
||||
* @param cursor
|
||||
* @param iterable must not be {@literal null}.
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
FindIterable<Document> prepare(FindIterable<Document> cursor);
|
||||
FindIterable<Document> prepare(FindIterable<Document> iterable);
|
||||
|
||||
/**
|
||||
* Apply query specific settings to {@link MongoCollection} and initate a find operation returning a
|
||||
@@ -53,7 +54,7 @@ public interface CursorPreparer extends ReadPreferenceAware {
|
||||
*
|
||||
* @param collection must not be {@literal null}.
|
||||
* @param find must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @throws IllegalArgumentException if one of the required arguments is {@literal null}.
|
||||
* @since 2.2
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.mongodb.MongoException;
|
||||
/**
|
||||
* An interface used by {@link MongoTemplate} for processing documents returned from a MongoDB query on a per-document
|
||||
* basis. Implementations of this interface perform the actual work of prcoessing each document but don't need to worry
|
||||
* about exception handling. {@MongoException}s will be caught and translated by the calling MongoTemplate An
|
||||
* about exception handling. {@link MongoException}s will be caught and translated by the calling MongoTemplate An
|
||||
* DocumentCallbackHandler is typically stateful: It keeps the result state within the object, to be available later for
|
||||
* later inspection.
|
||||
*
|
||||
|
||||
@@ -66,7 +66,7 @@ class EntityOperations {
|
||||
* Creates a new {@link Entity} for the given bean.
|
||||
*
|
||||
* @param entity must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Entity}.
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public <T> Entity<T> forEntity(T entity) {
|
||||
@@ -89,7 +89,7 @@ class EntityOperations {
|
||||
*
|
||||
* @param entity must not be {@literal null}.
|
||||
* @param conversionService must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link AdaptibleEntity}.
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public <T> AdaptibleEntity<T> forEntity(T entity, ConversionService conversionService) {
|
||||
@@ -108,6 +108,10 @@ class EntityOperations {
|
||||
return AdaptibleMappedEntity.of(entity, context, conversionService);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param entityClass should not be null.
|
||||
* @return the {@link MongoPersistentEntity#getCollection() collection name}.
|
||||
*/
|
||||
public String determineCollectionName(@Nullable Class<?> entityClass) {
|
||||
|
||||
if (entityClass == null) {
|
||||
@@ -138,7 +142,7 @@ class EntityOperations {
|
||||
* {@code _id} if no identifier property can be found.
|
||||
*
|
||||
* @param type must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public String getIdPropertyName(Class<?> type) {
|
||||
|
||||
|
||||
@@ -88,9 +88,9 @@ public interface ExecutableAggregationOperation {
|
||||
|
||||
/**
|
||||
* Apply pipeline operations as specified and stream all matching elements. <br />
|
||||
* Returns a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.Cursor}
|
||||
* Returns a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable}
|
||||
*
|
||||
* @return a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.Cursor} that needs to be closed.
|
||||
* @return a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable} that needs to be closed.
|
||||
* Never {@literal null}.
|
||||
*/
|
||||
CloseableIterator<T> stream();
|
||||
|
||||
@@ -118,7 +118,7 @@ public interface ExecutableFindOperation {
|
||||
/**
|
||||
* Stream all matching elements.
|
||||
*
|
||||
* @return a {@link Stream} that wraps the a Mongo DB {@link com.mongodb.Cursor} that needs to be closed. Never
|
||||
* @return a {@link Stream} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable} that needs to be closed. Never
|
||||
* {@literal null}.
|
||||
*/
|
||||
Stream<T> stream();
|
||||
|
||||
@@ -257,9 +257,9 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
|
||||
* @see org.springframework.data.mongodb.core.CursorPreparer#prepare(com.mongodb.clientFindIterable)
|
||||
*/
|
||||
@Override
|
||||
public FindIterable<Document> prepare(FindIterable<Document> cursor) {
|
||||
public FindIterable<Document> prepare(FindIterable<Document> iterable) {
|
||||
|
||||
FindIterable<Document> target = delegate != null ? delegate.prepare(cursor) : cursor;
|
||||
FindIterable<Document> target = delegate != null ? delegate.prepare(iterable) : iterable;
|
||||
return limit.map(target::limit).orElse(target);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ public class FindAndModifyOptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new {@link FindAndModifyOptions} based on option of given {@litearl source}.
|
||||
* Create new {@link FindAndModifyOptions} based on option of given {@literal source}.
|
||||
*
|
||||
* @param source can be {@literal null}.
|
||||
* @return new instance of {@link FindAndModifyOptions}.
|
||||
@@ -117,8 +117,8 @@ public class FindAndModifyOptions {
|
||||
/**
|
||||
* Define the {@link Collation} specifying language-specific rules for string comparison.
|
||||
*
|
||||
* @param collation
|
||||
* @return
|
||||
* @param collation can be {@literal null}.
|
||||
* @return this.
|
||||
* @since 2.0
|
||||
*/
|
||||
public FindAndModifyOptions collation(@Nullable Collation collation) {
|
||||
@@ -142,7 +142,7 @@ public class FindAndModifyOptions {
|
||||
/**
|
||||
* Get the {@link Collation} specifying language-specific rules for string comparison.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @since 2.0
|
||||
*/
|
||||
public Optional<Collation> getCollation() {
|
||||
|
||||
@@ -116,7 +116,7 @@ public class FindAndReplaceOptions {
|
||||
/**
|
||||
* Get the bit indicating to return the replacement document.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal true} if set.
|
||||
*/
|
||||
public boolean isReturnNew() {
|
||||
return returnNew;
|
||||
@@ -125,7 +125,7 @@ public class FindAndReplaceOptions {
|
||||
/**
|
||||
* Get the bit indicating if to create a new document if not exists.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal true} if set.
|
||||
*/
|
||||
public boolean isUpsert() {
|
||||
return upsert;
|
||||
|
||||
@@ -54,7 +54,7 @@ public interface FindPublisherPreparer extends ReadPreferenceAware {
|
||||
*
|
||||
* @param collection must not be {@literal null}.
|
||||
* @param find must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @throws IllegalArgumentException if one of the required arguments is {@literal null}.
|
||||
* @since 2.2
|
||||
*/
|
||||
|
||||
@@ -47,7 +47,7 @@ class GeoCommandStatistics {
|
||||
* Creates a new {@link GeoCommandStatistics} from the given command result extracting the statistics.
|
||||
*
|
||||
* @param commandResult must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public static GeoCommandStatistics from(Document commandResult) {
|
||||
|
||||
@@ -61,7 +61,7 @@ class GeoCommandStatistics {
|
||||
* Returns the average distance reported by the command result. Mitigating a removal of the field in case the command
|
||||
* didn't return any result introduced in MongoDB 3.2 RC1.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}, uses {@link Double#NaN} if {@literal avgDistance} does not exist.
|
||||
* @see <a href="https://jira.mongodb.org/browse/SERVER-21024">MongoDB Jira SERVER-21024</a>
|
||||
*/
|
||||
public double getAverageDistance() {
|
||||
|
||||
@@ -79,7 +79,7 @@ public interface MongoOperations extends FluentMongoOperations {
|
||||
* The collection name used for the specified class by this template.
|
||||
*
|
||||
* @param entityClass must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
String getCollectionName(Class<?> entityClass);
|
||||
|
||||
@@ -363,7 +363,7 @@ public interface MongoOperations extends FluentMongoOperations {
|
||||
/**
|
||||
* Returns the {@link ScriptOperations} that can be performed on {@link com.mongodb.client.MongoDatabase} level.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @since 1.7
|
||||
* @deprecated since 2.2. The {@code eval} command has been removed without replacement in MongoDB Server 4.2.0.
|
||||
*/
|
||||
@@ -1557,7 +1557,7 @@ public interface MongoOperations extends FluentMongoOperations {
|
||||
/**
|
||||
* Returns the underlying {@link MongoConverter}.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
MongoConverter getConverter();
|
||||
}
|
||||
|
||||
@@ -3199,9 +3199,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.CursorPreparer#prepare(com.mongodb.DBCursor)
|
||||
*/
|
||||
public FindIterable<Document> prepare(FindIterable<Document> cursor) {
|
||||
public FindIterable<Document> prepare(FindIterable<Document> iterable) {
|
||||
|
||||
FindIterable<Document> cursorToUse = cursor;
|
||||
FindIterable<Document> cursorToUse = iterable;
|
||||
|
||||
operations.forType(type).getCollation(query) //
|
||||
.map(Collation::toMongoCollation) //
|
||||
|
||||
@@ -1239,7 +1239,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
|
||||
* domain type information. Use {@link #updateFirst(Query, UpdateDefinition, Class, String)} to get full type specific
|
||||
* support. <br />
|
||||
* <strong>NOTE:</strong> {@link Query#getSortObject() sorting} is not supported by {@code db.collection.updateOne}.
|
||||
* Use {@link #findAndModify(Query, Update, Class, String)} instead.
|
||||
* Use {@link #findAndModify(Query, UpdateDefinition, Class, String)} instead.
|
||||
*
|
||||
* @param query the query document that specifies the criteria used to select a record to be updated. Must not be
|
||||
* {@literal null}.
|
||||
@@ -1572,7 +1572,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
|
||||
/**
|
||||
* Returns the underlying {@link MongoConverter}.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
MongoConverter getConverter();
|
||||
|
||||
@@ -1580,7 +1580,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
|
||||
* The collection name used for the specified class by this template.
|
||||
*
|
||||
* @param entityClass must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @since 2.1
|
||||
*/
|
||||
String getCollectionName(Class<?> entityClass);
|
||||
|
||||
@@ -319,8 +319,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
|
||||
/**
|
||||
* Configures the {@link WriteConcern} to be used with the template. If none is configured the {@link WriteConcern}
|
||||
* configured on the {@link MongoDatabaseFactory} will apply. If you configured a {@link Mongo} instance no
|
||||
* {@link WriteConcern} will be used.
|
||||
* configured on the {@link MongoDatabaseFactory} will apply.
|
||||
*
|
||||
* @param writeConcern can be {@literal null}.
|
||||
*/
|
||||
@@ -2411,7 +2410,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* @param query the query document that specifies the criteria used to find a record.
|
||||
* @param fields the document that specifies the fields to be returned.
|
||||
* @param entityClass the parameterized type of the returned list.
|
||||
* @param preparer allows for customization of the {@link DBCursor} used when iterating over the result set, (apply
|
||||
* @param preparer allows for customization of the {@link com.mongodb.client.FindIterable} used when iterating over the result set, (apply
|
||||
* limits, skips and so on).
|
||||
* @return the {@link List} of converted objects.
|
||||
*/
|
||||
@@ -2842,7 +2841,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
|
||||
/**
|
||||
* Simple {@link ReactiveCollectionCallback} that takes a query {@link Document} plus an optional fields specification
|
||||
* {@link Document} and executes that against the {@link DBCollection}.
|
||||
* {@link Document} and executes that against the {@link MongoCollection}.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Risberg
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
package org.springframework.data.mongodb.core;
|
||||
|
||||
/**
|
||||
* Enum to represent how strict the check of {@link com.mongodb.WriteResult} shall be. It can either be skipped entirely
|
||||
* (use {@link #NONE}) or cause an exception to be thrown {@link #EXCEPTION}.
|
||||
* Enum to represent how strict the check of {@link com.mongodb.WriteConcernResult} shall be. It can either be skipped
|
||||
* entirely (use {@link #NONE}) or cause an exception to be thrown {@link #EXCEPTION}.
|
||||
*
|
||||
* @author Thomas Risberg
|
||||
* @author Oliver Gierke
|
||||
|
||||
@@ -34,7 +34,7 @@ public class AccumulatorOperators {
|
||||
* Take the numeric value referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link AccumulatorOperatorFactory}.
|
||||
*/
|
||||
public static AccumulatorOperatorFactory valueOf(String fieldReference) {
|
||||
return new AccumulatorOperatorFactory(fieldReference);
|
||||
@@ -44,7 +44,7 @@ public class AccumulatorOperators {
|
||||
* Take the numeric value referenced resulting from given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link AccumulatorOperatorFactory}.
|
||||
*/
|
||||
public static AccumulatorOperatorFactory valueOf(AggregationExpression expression) {
|
||||
return new AccumulatorOperatorFactory(expression);
|
||||
@@ -86,7 +86,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and calculates and
|
||||
* returns the sum.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Sum}.
|
||||
*/
|
||||
public Sum sum() {
|
||||
return usesFieldRef() ? Sum.sumOf(fieldReference) : Sum.sumOf(expression);
|
||||
@@ -96,7 +96,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and returns the
|
||||
* average value.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Avg}.
|
||||
*/
|
||||
public Avg avg() {
|
||||
return usesFieldRef() ? Avg.avgOf(fieldReference) : Avg.avgOf(expression);
|
||||
@@ -106,7 +106,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and returns the
|
||||
* maximum value.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Max}.
|
||||
*/
|
||||
public Max max() {
|
||||
return usesFieldRef() ? Max.maxOf(fieldReference) : Max.maxOf(expression);
|
||||
@@ -116,7 +116,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and returns the
|
||||
* minimum value.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Min}.
|
||||
*/
|
||||
public Min min() {
|
||||
return usesFieldRef() ? Min.minOf(fieldReference) : Min.minOf(expression);
|
||||
@@ -126,7 +126,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and calculates the
|
||||
* population standard deviation of the input values.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link StdDevPop}.
|
||||
*/
|
||||
public StdDevPop stdDevPop() {
|
||||
return usesFieldRef() ? StdDevPop.stdDevPopOf(fieldReference) : StdDevPop.stdDevPopOf(expression);
|
||||
@@ -136,7 +136,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and calculates the
|
||||
* sample standard deviation of the input values.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link StdDevSamp}.
|
||||
*/
|
||||
public StdDevSamp stdDevSamp() {
|
||||
return usesFieldRef() ? StdDevSamp.stdDevSampOf(fieldReference) : StdDevSamp.stdDevSampOf(expression);
|
||||
@@ -167,7 +167,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link Sum}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Sum}.
|
||||
*/
|
||||
public static Sum sumOf(String fieldReference) {
|
||||
|
||||
@@ -179,7 +179,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link Sum}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Sum}.
|
||||
*/
|
||||
public static Sum sumOf(AggregationExpression expression) {
|
||||
|
||||
@@ -192,7 +192,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Sum}.
|
||||
*/
|
||||
public Sum and(String fieldReference) {
|
||||
|
||||
@@ -205,7 +205,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Sum}.
|
||||
*/
|
||||
public Sum and(AggregationExpression expression) {
|
||||
|
||||
@@ -264,7 +264,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link Avg}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Avg}.
|
||||
*/
|
||||
public static Avg avgOf(String fieldReference) {
|
||||
|
||||
@@ -276,7 +276,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link Avg}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Avg}.
|
||||
*/
|
||||
public static Avg avgOf(AggregationExpression expression) {
|
||||
|
||||
@@ -289,7 +289,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Avg}.
|
||||
*/
|
||||
public Avg and(String fieldReference) {
|
||||
|
||||
@@ -302,7 +302,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Avg}.
|
||||
*/
|
||||
public Avg and(AggregationExpression expression) {
|
||||
|
||||
@@ -347,7 +347,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link Max}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Max}.
|
||||
*/
|
||||
public static Max maxOf(String fieldReference) {
|
||||
|
||||
@@ -359,7 +359,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link Max}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Max}.
|
||||
*/
|
||||
public static Max maxOf(AggregationExpression expression) {
|
||||
|
||||
@@ -372,7 +372,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Max}.
|
||||
*/
|
||||
public Max and(String fieldReference) {
|
||||
|
||||
@@ -385,7 +385,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Max}.
|
||||
*/
|
||||
public Max and(AggregationExpression expression) {
|
||||
|
||||
@@ -430,7 +430,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link Min}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Min}.
|
||||
*/
|
||||
public static Min minOf(String fieldReference) {
|
||||
|
||||
@@ -442,7 +442,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link Min}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Min}.
|
||||
*/
|
||||
public static Min minOf(AggregationExpression expression) {
|
||||
|
||||
@@ -455,7 +455,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Min}.
|
||||
*/
|
||||
public Min and(String fieldReference) {
|
||||
|
||||
@@ -468,7 +468,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Min}.
|
||||
*/
|
||||
public Min and(AggregationExpression expression) {
|
||||
|
||||
@@ -513,7 +513,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link StdDevPop}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StdDevPop}.
|
||||
*/
|
||||
public static StdDevPop stdDevPopOf(String fieldReference) {
|
||||
|
||||
@@ -525,7 +525,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link StdDevPop} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StdDevPop}.
|
||||
*/
|
||||
public static StdDevPop stdDevPopOf(AggregationExpression expression) {
|
||||
|
||||
@@ -538,7 +538,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StdDevPop}.
|
||||
*/
|
||||
public StdDevPop and(String fieldReference) {
|
||||
|
||||
@@ -551,7 +551,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StdDevPop}.
|
||||
*/
|
||||
public StdDevPop and(AggregationExpression expression) {
|
||||
|
||||
@@ -596,7 +596,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link StdDevSamp}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StdDevSamp}.
|
||||
*/
|
||||
public static StdDevSamp stdDevSampOf(String fieldReference) {
|
||||
|
||||
@@ -608,7 +608,7 @@ public class AccumulatorOperators {
|
||||
* Creates new {@link StdDevSamp}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StdDevSamp}.
|
||||
*/
|
||||
public static StdDevSamp stdDevSampOf(AggregationExpression expression) {
|
||||
|
||||
@@ -621,7 +621,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StdDevSamp}.
|
||||
*/
|
||||
public StdDevSamp and(String fieldReference) {
|
||||
|
||||
@@ -634,7 +634,7 @@ public class AccumulatorOperators {
|
||||
* <strong>NOTE:</strong> Only possible in {@code $project} stage.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StdDevSamp}.
|
||||
*/
|
||||
public StdDevSamp and(AggregationExpression expression) {
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ public class Aggregation {
|
||||
* supported in MongoDB version 2.6+.
|
||||
*
|
||||
* @param options must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Aggregation}.
|
||||
* @since 1.6
|
||||
*/
|
||||
public Aggregation withOptions(AggregationOptions options) {
|
||||
@@ -259,7 +259,7 @@ public class Aggregation {
|
||||
* Creates a new {@link ProjectionOperation} including the given fields.
|
||||
*
|
||||
* @param fields must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ProjectionOperation}.
|
||||
*/
|
||||
public static ProjectionOperation project(String... fields) {
|
||||
return project(fields(fields));
|
||||
@@ -269,7 +269,7 @@ public class Aggregation {
|
||||
* Creates a new {@link ProjectionOperation} including the given {@link Fields}.
|
||||
*
|
||||
* @param fields must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ProjectionOperation}.
|
||||
*/
|
||||
public static ProjectionOperation project(Fields fields) {
|
||||
return new ProjectionOperation(fields);
|
||||
@@ -292,7 +292,7 @@ public class Aggregation {
|
||||
* Factory method to create a new {@link UnwindOperation} for the field with the given name.
|
||||
*
|
||||
* @param field must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link UnwindOperation}.
|
||||
*/
|
||||
public static UnwindOperation unwind(String field) {
|
||||
return new UnwindOperation(field(field));
|
||||
@@ -302,7 +302,7 @@ public class Aggregation {
|
||||
* Factory method to create a new {@link ReplaceRootOperation} for the field with the given name.
|
||||
*
|
||||
* @param fieldName must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link ReplaceRootOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static ReplaceRootOperation replaceRoot(String fieldName) {
|
||||
@@ -314,7 +314,7 @@ public class Aggregation {
|
||||
* {@link AggregationExpression}.
|
||||
*
|
||||
* @param aggregationExpression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ReplaceRootOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static ReplaceRootOperation replaceRoot(AggregationExpression aggregationExpression) {
|
||||
@@ -380,7 +380,7 @@ public class Aggregation {
|
||||
* Creates a new {@link GroupOperation} for the given fields.
|
||||
*
|
||||
* @param fields must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link GroupOperation}.
|
||||
*/
|
||||
public static GroupOperation group(String... fields) {
|
||||
return group(fields(fields));
|
||||
@@ -401,7 +401,7 @@ public class Aggregation {
|
||||
* {@link GraphLookupOperation} given {@literal fromCollection}.
|
||||
*
|
||||
* @param fromCollection must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link StartWithBuilder} for creating a {@link GraphLookupOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static StartWithBuilder graphLookup(String fromCollection) {
|
||||
@@ -412,7 +412,7 @@ public class Aggregation {
|
||||
* Factory method to create a new {@link SortOperation} for the given {@link Sort}.
|
||||
*
|
||||
* @param sort must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SortOperation}.
|
||||
*/
|
||||
public static SortOperation sort(Sort sort) {
|
||||
return new SortOperation(sort);
|
||||
@@ -423,7 +423,7 @@ public class Aggregation {
|
||||
*
|
||||
* @param direction must not be {@literal null}.
|
||||
* @param fields must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SortOperation}.
|
||||
*/
|
||||
public static SortOperation sort(Direction direction, String... fields) {
|
||||
return new SortOperation(Sort.by(direction, fields));
|
||||
@@ -433,7 +433,7 @@ public class Aggregation {
|
||||
* Creates a new {@link SortByCountOperation} given {@literal groupByField}.
|
||||
*
|
||||
* @param field must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link SortByCountOperation}.
|
||||
* @since 2.1
|
||||
*/
|
||||
public static SortByCountOperation sortByCount(String field) {
|
||||
@@ -444,7 +444,7 @@ public class Aggregation {
|
||||
* Creates a new {@link SortByCountOperation} given {@link AggregationExpression group and sort expression}.
|
||||
*
|
||||
* @param groupAndSortExpression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SortByCountOperation}.
|
||||
* @since 2.1
|
||||
*/
|
||||
public static SortByCountOperation sortByCount(AggregationExpression groupAndSortExpression) {
|
||||
@@ -455,9 +455,10 @@ public class Aggregation {
|
||||
* Creates a new {@link SkipOperation} skipping the given number of elements.
|
||||
*
|
||||
* @param elementsToSkip must not be less than zero.
|
||||
* @return
|
||||
* @return new instance of {@link SkipOperation}.
|
||||
* @deprecated prepare to get this one removed in favor of {@link #skip(long)}.
|
||||
*/
|
||||
@Deprecated
|
||||
public static SkipOperation skip(int elementsToSkip) {
|
||||
return new SkipOperation(elementsToSkip);
|
||||
}
|
||||
@@ -466,7 +467,7 @@ public class Aggregation {
|
||||
* Creates a new {@link SkipOperation} skipping the given number of elements.
|
||||
*
|
||||
* @param elementsToSkip must not be less than zero.
|
||||
* @return
|
||||
* @return new instance of {@link SkipOperation}.
|
||||
*/
|
||||
public static SkipOperation skip(long elementsToSkip) {
|
||||
return new SkipOperation(elementsToSkip);
|
||||
@@ -476,7 +477,7 @@ public class Aggregation {
|
||||
* Creates a new {@link LimitOperation} limiting the result to the given number of elements.
|
||||
*
|
||||
* @param maxElements must not be less than zero.
|
||||
* @return
|
||||
* @return new instance of {@link LimitOperation}.
|
||||
*/
|
||||
public static LimitOperation limit(long maxElements) {
|
||||
return new LimitOperation(maxElements);
|
||||
@@ -486,7 +487,7 @@ public class Aggregation {
|
||||
* Creates a new {@link SampleOperation} to select the specified number of documents from its input randomly.
|
||||
*
|
||||
* @param sampleSize must not be less than zero.
|
||||
* @return
|
||||
* @return new instance of {@link SampleOperation}.
|
||||
* @since 2.0
|
||||
*/
|
||||
public static SampleOperation sample(long sampleSize) {
|
||||
@@ -497,7 +498,7 @@ public class Aggregation {
|
||||
* Creates a new {@link MatchOperation} using the given {@link Criteria}.
|
||||
*
|
||||
* @param criteria must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link MatchOperation}.
|
||||
*/
|
||||
public static MatchOperation match(Criteria criteria) {
|
||||
return new MatchOperation(criteria);
|
||||
@@ -507,7 +508,7 @@ public class Aggregation {
|
||||
* Creates a new {@link MatchOperation} using the given {@link CriteriaDefinition}.
|
||||
*
|
||||
* @param criteria must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link MatchOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static MatchOperation match(CriteriaDefinition criteria) {
|
||||
@@ -520,7 +521,7 @@ public class Aggregation {
|
||||
*
|
||||
* @param query must not be {@literal null}.
|
||||
* @param distanceField must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link GeoNearOperation}.
|
||||
* @since 1.7
|
||||
*/
|
||||
public static GeoNearOperation geoNear(NearQuery query, String distanceField) {
|
||||
@@ -546,7 +547,7 @@ public class Aggregation {
|
||||
* collection in the current database if one does not already exist. The collection is not visible until the
|
||||
* aggregation completes. If the aggregation fails, MongoDB does not create the collection. Must not be
|
||||
* {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link OutOperation}.
|
||||
*/
|
||||
public static OutOperation out(String outCollectionName) {
|
||||
return new OutOperation(outCollectionName);
|
||||
@@ -556,7 +557,7 @@ public class Aggregation {
|
||||
* Creates a new {@link BucketOperation} given {@literal groupByField}.
|
||||
*
|
||||
* @param groupByField must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link BucketOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static BucketOperation bucket(String groupByField) {
|
||||
@@ -567,7 +568,7 @@ public class Aggregation {
|
||||
* Creates a new {@link BucketOperation} given {@link AggregationExpression group-by expression}.
|
||||
*
|
||||
* @param groupByExpression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link BucketOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static BucketOperation bucket(AggregationExpression groupByExpression) {
|
||||
@@ -579,7 +580,7 @@ public class Aggregation {
|
||||
*
|
||||
* @param groupByField must not be {@literal null} or empty.
|
||||
* @param buckets number of buckets, must be a positive integer.
|
||||
* @return
|
||||
* @return new instance of {@link BucketAutoOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static BucketAutoOperation bucketAuto(String groupByField, int buckets) {
|
||||
@@ -591,7 +592,7 @@ public class Aggregation {
|
||||
*
|
||||
* @param groupByExpression must not be {@literal null}.
|
||||
* @param buckets number of buckets, must be a positive integer.
|
||||
* @return
|
||||
* @return new instance of {@link BucketAutoOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static BucketAutoOperation bucketAuto(AggregationExpression groupByExpression, int buckets) {
|
||||
@@ -601,7 +602,7 @@ public class Aggregation {
|
||||
/**
|
||||
* Creates a new {@link FacetOperation}.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link FacetOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static FacetOperation facet() {
|
||||
@@ -612,7 +613,7 @@ public class Aggregation {
|
||||
* Creates a new {@link FacetOperationBuilder} given {@link Aggregation}.
|
||||
*
|
||||
* @param aggregationOperations the sub-pipeline, must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link FacetOperation}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static FacetOperationBuilder facet(AggregationOperation... aggregationOperations) {
|
||||
@@ -681,7 +682,7 @@ public class Aggregation {
|
||||
* Creates a new {@link Fields} instance for the given field names.
|
||||
*
|
||||
* @param fields must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Fields}.
|
||||
* @see Fields#fields(String...)
|
||||
*/
|
||||
public static Fields fields(String... fields) {
|
||||
@@ -693,7 +694,7 @@ public class Aggregation {
|
||||
*
|
||||
* @param name must not be {@literal null} or empty.
|
||||
* @param target must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link Fields}.
|
||||
*/
|
||||
public static Fields bind(String name, String target) {
|
||||
return Fields.from(field(name, target));
|
||||
@@ -702,7 +703,7 @@ public class Aggregation {
|
||||
/**
|
||||
* Returns a new {@link AggregationOptions.Builder}.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link AggregationOptions.Builder}.
|
||||
* @since 1.6
|
||||
*/
|
||||
public static AggregationOptions.Builder newAggregationOptions() {
|
||||
@@ -764,7 +765,7 @@ public class Aggregation {
|
||||
* otherwise.
|
||||
*
|
||||
* @param fieldRef may be {@literal null}.
|
||||
* @return
|
||||
* @return {@literal true} if the given field refers to a {@link SystemVariable}.
|
||||
*/
|
||||
public static boolean isReferingToSystemVariable(@Nullable String fieldRef) {
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ public interface AggregationExpression {
|
||||
* Turns the {@link AggregationExpression} into a {@link Document} within the given
|
||||
* {@link AggregationOperationContext}.
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
* @param context must not be {@literal null}.
|
||||
* @return the MongoDB native ({@link Document}) form of the expression.
|
||||
*/
|
||||
Document toDocument(AggregationOperationContext context);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ interface AggregationExpressionTransformer
|
||||
* @param currentNode must not be {@literal null}.
|
||||
* @param parentNode may be {@literal null}.
|
||||
* @param previousOperationObject may be {@literal null}.
|
||||
* @param aggregationContext must not be {@literal null}.
|
||||
* @param context must not be {@literal null}.
|
||||
*/
|
||||
public AggregationExpressionTransformationContext(T currentNode, @Nullable ExpressionNode parentNode,
|
||||
@Nullable Document previousOperationObject, AggregationOperationContext context) {
|
||||
@@ -67,7 +67,7 @@ interface AggregationExpressionTransformer
|
||||
/**
|
||||
* Returns the underlying {@link AggregationOperationContext}.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public AggregationOperationContext getAggregationContext() {
|
||||
return aggregationContext;
|
||||
@@ -76,7 +76,7 @@ interface AggregationExpressionTransformer
|
||||
/**
|
||||
* Returns the {@link FieldReference} for the current {@link ExpressionNode}.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public FieldReference getFieldReference() {
|
||||
return aggregationContext.getReference(getCurrentNode().getName());
|
||||
|
||||
@@ -41,7 +41,7 @@ public enum AggregationFunctionExpressions {
|
||||
* Returns an {@link AggregationExpression} build from the current {@link Enum} name and the given parameters.
|
||||
*
|
||||
* @param parameters must not be {@literal null}
|
||||
* @return
|
||||
* @return new instance of {@link AggregationExpression}.
|
||||
*/
|
||||
public AggregationExpression of(Object... parameters) {
|
||||
|
||||
|
||||
@@ -57,20 +57,20 @@ public interface AggregationOperationContext {
|
||||
Document getMappedObject(Document document, @Nullable Class<?> type);
|
||||
|
||||
/**
|
||||
* Returns a {@link FieldReference} for the given field or {@literal null} if the context does not expose the given
|
||||
* field.
|
||||
* Returns a {@link FieldReference} for the given field.
|
||||
*
|
||||
* @param field must not be {@literal null}.
|
||||
* @return
|
||||
* @return the {@link FieldReference} for the given {@link Field}.
|
||||
* @throws IllegalArgumentException if the context does not expose a field with the given name
|
||||
*/
|
||||
FieldReference getReference(Field field);
|
||||
|
||||
/**
|
||||
* Returns the {@link FieldReference} for the field with the given name or {@literal null} if the context does not
|
||||
* expose a field with the given name.
|
||||
* Returns the {@link FieldReference} for the field with the given name.
|
||||
*
|
||||
* @param name must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return the {@link FieldReference} for the field with given {@literal name}.
|
||||
* @throws IllegalArgumentException if the context does not expose a field with the given name
|
||||
*/
|
||||
FieldReference getReference(String name);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class AggregationOptions {
|
||||
* @param allowDiskUse whether to off-load intensive sort-operations to disk.
|
||||
* @param explain whether to get the execution plan for the aggregation instead of the actual results.
|
||||
* @param cursor can be {@literal null}, used to pass additional options (such as {@code batchSize}) to the
|
||||
* aggregation.
|
||||
* aggregation.
|
||||
* @param collation collation for string comparison. Can be {@literal null}.
|
||||
* @since 2.0
|
||||
*/
|
||||
@@ -85,7 +85,7 @@ public class AggregationOptions {
|
||||
* @param allowDiskUse whether to off-load intensive sort-operations to disk.
|
||||
* @param explain whether to get the execution plan for the aggregation instead of the actual results.
|
||||
* @param cursor can be {@literal null}, used to pass additional options (such as {@code batchSize}) to the
|
||||
* aggregation.
|
||||
* aggregation.
|
||||
* @param collation collation for string comparison. Can be {@literal null}.
|
||||
* @param comment execution comment. Can be {@literal null}.
|
||||
* @since 2.2
|
||||
@@ -151,7 +151,7 @@ public class AggregationOptions {
|
||||
* Enables writing to temporary files. When set to true, aggregation stages can write data to the _tmp subdirectory in
|
||||
* the dbPath directory.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal true} if enabled.
|
||||
*/
|
||||
public boolean isAllowDiskUse() {
|
||||
return allowDiskUse;
|
||||
@@ -160,7 +160,7 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Specifies to return the information on the processing of the pipeline.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal true} if enabled.
|
||||
*/
|
||||
public boolean isExplain() {
|
||||
return explain;
|
||||
@@ -185,7 +185,7 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Specify a document that contains options that control the creation of the cursor object.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Optional<Document> getCursor() {
|
||||
return cursor;
|
||||
@@ -194,7 +194,7 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Get collation settings for string comparison.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @since 2.0
|
||||
*/
|
||||
public Optional<Collation> getCollation() {
|
||||
@@ -204,7 +204,7 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Get the comment for the aggregation.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @since 2.2
|
||||
*/
|
||||
public Optional<String> getComment() {
|
||||
@@ -256,7 +256,7 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Returns a {@link Document} representation of this {@link AggregationOptions}.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Document toDocument() {
|
||||
|
||||
@@ -276,7 +276,7 @@ public class AggregationOptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return {@literal true} if {@link #maxTime} is set to a positive value.
|
||||
* @since 3.0
|
||||
*/
|
||||
public boolean hasExecutionTimeLimit() {
|
||||
@@ -313,8 +313,8 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Defines whether to off-load intensive sort-operations to disk.
|
||||
*
|
||||
* @param allowDiskUse
|
||||
* @return
|
||||
* @param allowDiskUse use {@literal true} to allow disk use during the aggregation.
|
||||
* @return this.
|
||||
*/
|
||||
public Builder allowDiskUse(boolean allowDiskUse) {
|
||||
|
||||
@@ -325,8 +325,8 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Defines whether to get the execution plan for the aggregation instead of the actual results.
|
||||
*
|
||||
* @param explain
|
||||
* @return
|
||||
* @param explain use {@literal true} to enable explain feature.
|
||||
* @return this.
|
||||
*/
|
||||
public Builder explain(boolean explain) {
|
||||
|
||||
@@ -337,8 +337,8 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Additional options to the aggregation.
|
||||
*
|
||||
* @param cursor
|
||||
* @return
|
||||
* @param cursor must not be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public Builder cursor(Document cursor) {
|
||||
|
||||
@@ -349,8 +349,8 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Define the initial cursor batch size.
|
||||
*
|
||||
* @param batchSize
|
||||
* @return
|
||||
* @param batchSize use a positive int.
|
||||
* @return this.
|
||||
* @since 2.0
|
||||
*/
|
||||
public Builder cursorBatchSize(int batchSize) {
|
||||
@@ -363,7 +363,7 @@ public class AggregationOptions {
|
||||
* Define collation settings for string comparison.
|
||||
*
|
||||
* @param collation can be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 2.0
|
||||
*/
|
||||
public Builder collation(@Nullable Collation collation) {
|
||||
@@ -376,7 +376,7 @@ public class AggregationOptions {
|
||||
* Define a comment to describe the execution.
|
||||
*
|
||||
* @param comment can be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 2.2
|
||||
*/
|
||||
public Builder comment(@Nullable String comment) {
|
||||
@@ -389,7 +389,7 @@ public class AggregationOptions {
|
||||
* Set the time limit for processing.
|
||||
*
|
||||
* @param maxTime {@link Duration#ZERO} is used for the default unbounded behavior. {@link Duration#isNegative()
|
||||
* Negative} values will be ignored.
|
||||
* Negative} values will be ignored.
|
||||
* @return this.
|
||||
* @since 3.0
|
||||
*/
|
||||
@@ -402,7 +402,7 @@ public class AggregationOptions {
|
||||
/**
|
||||
* Returns a new {@link AggregationOptions} instance with the given configuration.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link AggregationOptions}.
|
||||
*/
|
||||
public AggregationOptions build() {
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class AggregationResults<T> implements Iterable<T> {
|
||||
/**
|
||||
* Returns the aggregation results.
|
||||
*
|
||||
* @return
|
||||
* @return the list of already mapped results or an empty one if none found.
|
||||
*/
|
||||
public List<T> getMappedResults() {
|
||||
return mappedResults;
|
||||
@@ -68,7 +68,7 @@ public class AggregationResults<T> implements Iterable<T> {
|
||||
/**
|
||||
* Returns the unique mapped result. Assumes no result or exactly one.
|
||||
*
|
||||
* @return
|
||||
* @return the single already mapped result object or raise an error if more than one found.
|
||||
* @throws IllegalArgumentException in case more than one result is available.
|
||||
*/
|
||||
@Nullable
|
||||
@@ -88,7 +88,7 @@ public class AggregationResults<T> implements Iterable<T> {
|
||||
/**
|
||||
* Returns the server that has been used to perform the aggregation.
|
||||
*
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
public String getServerUsed() {
|
||||
@@ -98,7 +98,7 @@ public class AggregationResults<T> implements Iterable<T> {
|
||||
/**
|
||||
* Returns the raw result that was returned by the server.
|
||||
*
|
||||
* @return
|
||||
* @return the raw response.
|
||||
* @since 1.6
|
||||
*/
|
||||
public Document getRawResults() {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class AggregationSpELExpression implements AggregationExpression {
|
||||
*
|
||||
* @param expressionString must not be {@literal null}.
|
||||
* @param parameters can be empty.
|
||||
* @return
|
||||
* @return new instance of {@link AggregationSpELExpression}.
|
||||
*/
|
||||
public static AggregationSpELExpression expressionOf(String expressionString, Object... parameters) {
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition {
|
||||
* {@code $replaceWith} replaces the input document with the specified document. The operation replaces all existing
|
||||
* fields in the input document, including the <strong>_id</strong> field.
|
||||
*
|
||||
* @param replaceWithOperation
|
||||
* @param replaceWithOperation must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/replaceWith/">$replaceWith Aggregation
|
||||
* Reference</a>
|
||||
@@ -219,8 +219,8 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition {
|
||||
/**
|
||||
* Short for {@link #unset(UnsetOperation)}.
|
||||
*
|
||||
* @param keys
|
||||
* @return
|
||||
* @param keys the fields to remove.
|
||||
* @return this.
|
||||
*/
|
||||
public AggregationUpdate unset(String... keys) {
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@ interface AggregationUtils {
|
||||
* Converts the given {@link Range} into an array of values.
|
||||
*
|
||||
* @param range must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public static List<Long> toRangeValues(Range<Long> range) {
|
||||
static List<Long> toRangeValues(Range<Long> range) {
|
||||
|
||||
Assert.notNull(range, "Range must not be null!");
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ArithmeticOperators {
|
||||
* Take the field referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ArithmeticOperatorFactory}.
|
||||
*/
|
||||
public static ArithmeticOperatorFactory valueOf(String fieldReference) {
|
||||
return new ArithmeticOperatorFactory(fieldReference);
|
||||
@@ -48,7 +48,7 @@ public class ArithmeticOperators {
|
||||
* Take the value resulting from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ArithmeticOperatorFactory}.
|
||||
*/
|
||||
public static ArithmeticOperatorFactory valueOf(AggregationExpression expression) {
|
||||
return new ArithmeticOperatorFactory(expression);
|
||||
@@ -89,7 +89,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns the absolute value of the associated number.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Abs}.
|
||||
*/
|
||||
public Abs abs() {
|
||||
return usesFieldRef() ? Abs.absoluteValueOf(fieldReference) : Abs.absoluteValueOf(expression);
|
||||
@@ -100,7 +100,7 @@ public class ArithmeticOperators {
|
||||
* number.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Add}.
|
||||
*/
|
||||
public Add add(String fieldReference) {
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ArithmeticOperators {
|
||||
* {@link AggregationExpression} to the associated number.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Add}.
|
||||
*/
|
||||
public Add add(AggregationExpression expression) {
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that adds the given {@literal value} to the associated number.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Add}.
|
||||
*/
|
||||
public Add add(Number value) {
|
||||
|
||||
@@ -141,7 +141,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the smallest integer greater than or equal to the
|
||||
* assoicated number.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Ceil}.
|
||||
*/
|
||||
public Ceil ceil() {
|
||||
return usesFieldRef() ? Ceil.ceilValueOf(fieldReference) : Ceil.ceilValueOf(expression);
|
||||
@@ -152,7 +152,7 @@ public class ArithmeticOperators {
|
||||
* {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Divide}.
|
||||
*/
|
||||
public Divide divideBy(String fieldReference) {
|
||||
|
||||
@@ -165,7 +165,7 @@ public class ArithmeticOperators {
|
||||
* {@literal expression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Divide}.
|
||||
*/
|
||||
public Divide divideBy(AggregationExpression expression) {
|
||||
|
||||
@@ -176,8 +176,8 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that divides the associated number by given {@literal value}.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Divide}.
|
||||
*/
|
||||
public Divide divideBy(Number value) {
|
||||
|
||||
@@ -192,7 +192,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that raises Euler’s number (i.e. e ) on the associated number.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Exp}.
|
||||
*/
|
||||
public Exp exp() {
|
||||
return usesFieldRef() ? Exp.expValueOf(fieldReference) : Exp.expValueOf(expression);
|
||||
@@ -202,7 +202,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the largest integer less than or equal to the associated
|
||||
* number.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Floor}.
|
||||
*/
|
||||
public Floor floor() {
|
||||
return usesFieldRef() ? Floor.floorValueOf(fieldReference) : Floor.floorValueOf(expression);
|
||||
@@ -212,7 +212,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that calculates the natural logarithm ln (i.e loge) of the assoicated
|
||||
* number.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Ln}.
|
||||
*/
|
||||
public Ln ln() {
|
||||
return usesFieldRef() ? Ln.lnValueOf(fieldReference) : Ln.lnValueOf(expression);
|
||||
@@ -223,7 +223,7 @@ public class ArithmeticOperators {
|
||||
* referenced via {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Log}.
|
||||
*/
|
||||
public Log log(String fieldReference) {
|
||||
|
||||
@@ -236,7 +236,7 @@ public class ArithmeticOperators {
|
||||
* extracted by given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Log}.
|
||||
*/
|
||||
public Log log(AggregationExpression expression) {
|
||||
|
||||
@@ -249,7 +249,7 @@ public class ArithmeticOperators {
|
||||
* {@literal base}.
|
||||
*
|
||||
* @param base must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Log}.
|
||||
*/
|
||||
public Log log(Number base) {
|
||||
|
||||
@@ -264,7 +264,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that calculates the log base 10 for the associated number.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Log10}.
|
||||
*/
|
||||
public Log10 log10() {
|
||||
return usesFieldRef() ? Log10.log10ValueOf(fieldReference) : Log10.log10ValueOf(expression);
|
||||
@@ -275,7 +275,7 @@ public class ArithmeticOperators {
|
||||
* remainder.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Mod}.
|
||||
*/
|
||||
public Mod mod(String fieldReference) {
|
||||
|
||||
@@ -288,7 +288,7 @@ public class ArithmeticOperators {
|
||||
* remainder.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Mod}.
|
||||
*/
|
||||
public Mod mod(AggregationExpression expression) {
|
||||
|
||||
@@ -301,7 +301,7 @@ public class ArithmeticOperators {
|
||||
* remainder.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Mod}.
|
||||
*/
|
||||
public Mod mod(Number value) {
|
||||
|
||||
@@ -317,7 +317,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that multiplies the associated number with another.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Multiply}.
|
||||
*/
|
||||
public Multiply multiplyBy(String fieldReference) {
|
||||
|
||||
@@ -329,7 +329,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that multiplies the associated number with another.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Multiply}.
|
||||
*/
|
||||
public Multiply multiplyBy(AggregationExpression expression) {
|
||||
|
||||
@@ -341,7 +341,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that multiplies the associated number with another.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Multiply}.
|
||||
*/
|
||||
public Multiply multiplyBy(Number value) {
|
||||
|
||||
@@ -357,7 +357,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that raises the associated number to the specified exponent.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Pow}.
|
||||
*/
|
||||
public Pow pow(String fieldReference) {
|
||||
|
||||
@@ -369,7 +369,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that raises the associated number to the specified exponent.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Pow}.
|
||||
*/
|
||||
public Pow pow(AggregationExpression expression) {
|
||||
|
||||
@@ -381,7 +381,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that raises the associated number to the specified exponent.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Pow}.
|
||||
*/
|
||||
public Pow pow(Number value) {
|
||||
|
||||
@@ -396,7 +396,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that calculates the square root of the associated number.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Sqrt}.
|
||||
*/
|
||||
public Sqrt sqrt() {
|
||||
return usesFieldRef() ? Sqrt.sqrtOf(fieldReference) : Sqrt.sqrtOf(expression);
|
||||
@@ -406,7 +406,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that subtracts value of given from the associated number.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Subtract}.
|
||||
*/
|
||||
public Subtract subtract(String fieldReference) {
|
||||
|
||||
@@ -418,7 +418,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link AggregationExpression} that subtracts value of given from the associated number.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Subtract}.
|
||||
*/
|
||||
public Subtract subtract(AggregationExpression expression) {
|
||||
|
||||
@@ -429,8 +429,8 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that subtracts value from the associated number.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Subtract}.
|
||||
*/
|
||||
public Subtract subtract(Number value) {
|
||||
|
||||
@@ -445,7 +445,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that truncates a number to its integer.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Trunc}.
|
||||
*/
|
||||
public Trunc trunc() {
|
||||
return usesFieldRef() ? Trunc.truncValueOf(fieldReference) : Trunc.truncValueOf(expression);
|
||||
@@ -454,7 +454,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that calculates and returns the sum of numeric values.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Sum}.
|
||||
*/
|
||||
public Sum sum() {
|
||||
return usesFieldRef() ? AccumulatorOperators.Sum.sumOf(fieldReference)
|
||||
@@ -464,7 +464,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns the average value of the numeric values.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Avg}.
|
||||
*/
|
||||
public Avg avg() {
|
||||
return usesFieldRef() ? AccumulatorOperators.Avg.avgOf(fieldReference)
|
||||
@@ -474,7 +474,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns the maximum value.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Max}.
|
||||
*/
|
||||
public Max max() {
|
||||
return usesFieldRef() ? AccumulatorOperators.Max.maxOf(fieldReference)
|
||||
@@ -484,7 +484,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns the minimum value.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Min}.
|
||||
*/
|
||||
public Min min() {
|
||||
return usesFieldRef() ? AccumulatorOperators.Min.minOf(fieldReference)
|
||||
@@ -494,7 +494,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that calculates the population standard deviation of the input values.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link StdDevPop}.
|
||||
*/
|
||||
public StdDevPop stdDevPop() {
|
||||
return usesFieldRef() ? AccumulatorOperators.StdDevPop.stdDevPopOf(fieldReference)
|
||||
@@ -504,7 +504,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that calculates the sample standard deviation of the input values.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link StdDevSamp}.
|
||||
*/
|
||||
public StdDevSamp stdDevSamp() {
|
||||
return usesFieldRef() ? AccumulatorOperators.StdDevSamp.stdDevSampOf(fieldReference)
|
||||
@@ -557,7 +557,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Abs}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Abs}.
|
||||
*/
|
||||
public static Abs absoluteValueOf(String fieldReference) {
|
||||
|
||||
@@ -569,7 +569,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Abs}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Abs}.
|
||||
*/
|
||||
public static Abs absoluteValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -581,7 +581,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Abs}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Abs}.
|
||||
*/
|
||||
public static Abs absoluteValueOf(Number value) {
|
||||
|
||||
@@ -610,7 +610,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Add}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Add}.
|
||||
*/
|
||||
public static Add valueOf(String fieldReference) {
|
||||
|
||||
@@ -622,7 +622,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Add}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Add}.
|
||||
*/
|
||||
public static Add valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -634,7 +634,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Add}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Add}.
|
||||
*/
|
||||
public static Add valueOf(Number value) {
|
||||
|
||||
@@ -642,18 +642,36 @@ public class ArithmeticOperators {
|
||||
return new Add(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the value stored at the given field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return new instance of {@link Add}.
|
||||
*/
|
||||
public Add add(String fieldReference) {
|
||||
|
||||
Assert.notNull(fieldReference, "FieldReference must not be null!");
|
||||
return new Add(append(Fields.field(fieldReference)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the evaluation result of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link Add}.
|
||||
*/
|
||||
public Add add(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
return new Add(append(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Add}.
|
||||
*/
|
||||
public Add add(Number value) {
|
||||
return new Add(append(value));
|
||||
}
|
||||
@@ -679,7 +697,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Ceil}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ceil}.
|
||||
*/
|
||||
public static Ceil ceilValueOf(String fieldReference) {
|
||||
|
||||
@@ -691,7 +709,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Ceil}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ceil}.
|
||||
*/
|
||||
public static Ceil ceilValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -703,7 +721,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Ceil}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ceil}.
|
||||
*/
|
||||
public static Ceil ceilValueOf(Number value) {
|
||||
|
||||
@@ -732,7 +750,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Divide}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Divide}.
|
||||
*/
|
||||
public static Divide valueOf(String fieldReference) {
|
||||
|
||||
@@ -744,7 +762,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Divide}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Divide}.
|
||||
*/
|
||||
public static Divide valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -756,7 +774,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Divide}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Divide}.
|
||||
*/
|
||||
public static Divide valueOf(Number value) {
|
||||
|
||||
@@ -764,18 +782,36 @@ public class ArithmeticOperators {
|
||||
return new Divide(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide by the value stored at the given field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return new instance of {@link Divide}.
|
||||
*/
|
||||
public Divide divideBy(String fieldReference) {
|
||||
|
||||
Assert.notNull(fieldReference, "FieldReference must not be null!");
|
||||
return new Divide(append(Fields.field(fieldReference)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide by the evaluation results of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link Divide}.
|
||||
*/
|
||||
public Divide divideBy(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
return new Divide(append(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide by the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Divide}.
|
||||
*/
|
||||
public Divide divideBy(Number value) {
|
||||
return new Divide(append(value));
|
||||
}
|
||||
@@ -801,7 +837,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Exp}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Exp}.
|
||||
*/
|
||||
public static Exp expValueOf(String fieldReference) {
|
||||
|
||||
@@ -813,7 +849,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Exp}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Exp}.
|
||||
*/
|
||||
public static Exp expValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -825,7 +861,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Exp}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Exp}.
|
||||
*/
|
||||
public static Exp expValueOf(Number value) {
|
||||
|
||||
@@ -854,7 +890,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Floor}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Floor}.
|
||||
*/
|
||||
public static Floor floorValueOf(String fieldReference) {
|
||||
|
||||
@@ -866,7 +902,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Floor}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Floor}.
|
||||
*/
|
||||
public static Floor floorValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -878,7 +914,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Floor}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Floor}.
|
||||
*/
|
||||
public static Floor floorValueOf(Number value) {
|
||||
|
||||
@@ -907,7 +943,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Ln}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ln}.
|
||||
*/
|
||||
public static Ln lnValueOf(String fieldReference) {
|
||||
|
||||
@@ -919,7 +955,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Ln}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ln}.
|
||||
*/
|
||||
public static Ln lnValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -931,7 +967,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Ln}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ln}.
|
||||
*/
|
||||
public static Ln lnValueOf(Number value) {
|
||||
|
||||
@@ -960,7 +996,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Min}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Log}.
|
||||
*/
|
||||
public static Log valueOf(String fieldReference) {
|
||||
|
||||
@@ -972,7 +1008,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Log}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Log}.
|
||||
*/
|
||||
public static Log valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -992,18 +1028,36 @@ public class ArithmeticOperators {
|
||||
return new Log(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the value stored at the given field as log base.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return new instance of {@link Log}.
|
||||
*/
|
||||
public Log log(String fieldReference) {
|
||||
|
||||
Assert.notNull(fieldReference, "FieldReference must not be null!");
|
||||
return new Log(append(Fields.field(fieldReference)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the evaluated value of the given {@link AggregationExpression} as log base.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link Log}.
|
||||
*/
|
||||
public Log log(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
return new Log(append(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the given value as log base.
|
||||
*
|
||||
* @param base must not be {@literal null}.
|
||||
* @return new instance of {@link Log}.
|
||||
*/
|
||||
public Log log(Number base) {
|
||||
return new Log(append(base));
|
||||
}
|
||||
@@ -1029,7 +1083,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Log10}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Log10}.
|
||||
*/
|
||||
public static Log10 log10ValueOf(String fieldReference) {
|
||||
|
||||
@@ -1041,7 +1095,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Log10}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Log10}.
|
||||
*/
|
||||
public static Log10 log10ValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1053,7 +1107,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Log10}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Log10}.
|
||||
*/
|
||||
public static Log10 log10ValueOf(Number value) {
|
||||
|
||||
@@ -1082,7 +1136,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Mod}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Mod}.
|
||||
*/
|
||||
public static Mod valueOf(String fieldReference) {
|
||||
|
||||
@@ -1094,7 +1148,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Mod}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Mod}.
|
||||
*/
|
||||
public static Mod valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1106,7 +1160,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Mod}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Mod}.
|
||||
*/
|
||||
public static Mod valueOf(Number value) {
|
||||
|
||||
@@ -1114,18 +1168,36 @@ public class ArithmeticOperators {
|
||||
return new Mod(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the value stored at the given field as mod base.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return new instance of {@link Mod}.
|
||||
*/
|
||||
public Mod mod(String fieldReference) {
|
||||
|
||||
Assert.notNull(fieldReference, "FieldReference must not be null!");
|
||||
return new Mod(append(Fields.field(fieldReference)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use evaluated value of the given {@link AggregationExpression} as mod base.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link Mod}.
|
||||
*/
|
||||
public Mod mod(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
return new Mod(append(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the given value as mod base.
|
||||
*
|
||||
* @param base must not be {@literal null}.
|
||||
* @return new instance of {@link Mod}.
|
||||
*/
|
||||
public Mod mod(Number base) {
|
||||
return new Mod(append(base));
|
||||
}
|
||||
@@ -1151,7 +1223,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Multiply}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Multiply}.
|
||||
*/
|
||||
public static Multiply valueOf(String fieldReference) {
|
||||
|
||||
@@ -1163,7 +1235,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Multiply}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Multiply}.
|
||||
*/
|
||||
public static Multiply valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1175,7 +1247,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Multiply}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Multiply}.
|
||||
*/
|
||||
public static Multiply valueOf(Number value) {
|
||||
|
||||
@@ -1183,18 +1255,36 @@ public class ArithmeticOperators {
|
||||
return new Multiply(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply by the value stored at the given field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return new instance of {@link Multiply}.
|
||||
*/
|
||||
public Multiply multiplyBy(String fieldReference) {
|
||||
|
||||
Assert.notNull(fieldReference, "FieldReference must not be null!");
|
||||
return new Multiply(append(Fields.field(fieldReference)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply by the evaluated value of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link Multiply}.
|
||||
*/
|
||||
public Multiply multiplyBy(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
return new Multiply(append(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply by the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Multiply}.
|
||||
*/
|
||||
public Multiply multiplyBy(Number value) {
|
||||
return new Multiply(append(value));
|
||||
}
|
||||
@@ -1252,18 +1342,36 @@ public class ArithmeticOperators {
|
||||
return new Pow(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Pow by the value stored at the given field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return new instance of {@link Pow}.
|
||||
*/
|
||||
public Pow pow(String fieldReference) {
|
||||
|
||||
Assert.notNull(fieldReference, "FieldReference must not be null!");
|
||||
return new Pow(append(Fields.field(fieldReference)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Pow by the evaluated value of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link Pow}.
|
||||
*/
|
||||
public Pow pow(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
return new Pow(append(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Pow by the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Pow}.
|
||||
*/
|
||||
public Pow pow(Number value) {
|
||||
return new Pow(append(value));
|
||||
}
|
||||
@@ -1289,7 +1397,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Sqrt}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Sqrt}.
|
||||
*/
|
||||
public static Sqrt sqrtOf(String fieldReference) {
|
||||
|
||||
@@ -1301,7 +1409,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Sqrt}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Sqrt}.
|
||||
*/
|
||||
public static Sqrt sqrtOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1313,7 +1421,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Sqrt}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Sqrt}.
|
||||
*/
|
||||
public static Sqrt sqrtOf(Number value) {
|
||||
|
||||
@@ -1342,7 +1450,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Subtract}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Subtract}.
|
||||
*/
|
||||
public static Subtract valueOf(String fieldReference) {
|
||||
|
||||
@@ -1354,7 +1462,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Subtract}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Subtract}.
|
||||
*/
|
||||
public static Subtract valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1366,7 +1474,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Subtract}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Subtract}.
|
||||
*/
|
||||
public static Subtract valueOf(Number value) {
|
||||
|
||||
@@ -1374,18 +1482,36 @@ public class ArithmeticOperators {
|
||||
return new Subtract(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract the value stored at the given field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return new instance of {@link Pow}.
|
||||
*/
|
||||
public Subtract subtract(String fieldReference) {
|
||||
|
||||
Assert.notNull(fieldReference, "FieldReference must not be null!");
|
||||
return new Subtract(append(Fields.field(fieldReference)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract the evaluated value of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link Pow}.
|
||||
*/
|
||||
public Subtract subtract(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
return new Subtract(append(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Pow}.
|
||||
*/
|
||||
public Subtract subtract(Number value) {
|
||||
return new Subtract(append(value));
|
||||
}
|
||||
@@ -1411,7 +1537,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Trunc}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Trunc}.
|
||||
*/
|
||||
public static Trunc truncValueOf(String fieldReference) {
|
||||
|
||||
@@ -1423,7 +1549,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Trunc}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Trunc}.
|
||||
*/
|
||||
public static Trunc truncValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1435,7 +1561,7 @@ public class ArithmeticOperators {
|
||||
* Creates new {@link Trunc}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Trunc}.
|
||||
*/
|
||||
public static Trunc truncValueOf(Number value) {
|
||||
|
||||
@@ -1502,7 +1628,7 @@ public class ArithmeticOperators {
|
||||
/**
|
||||
* The place to round to. Can be between -20 and 100, exclusive.
|
||||
*
|
||||
* @param place
|
||||
* @param place value between -20 and 100, exclusive.
|
||||
* @return new instance of {@link Round}.
|
||||
*/
|
||||
public Round place(int place) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ArrayOperators {
|
||||
* Take the array referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ArrayOperatorFactory}.
|
||||
*/
|
||||
public static ArrayOperatorFactory arrayOf(String fieldReference) {
|
||||
return new ArrayOperatorFactory(fieldReference);
|
||||
@@ -53,7 +53,7 @@ public class ArrayOperators {
|
||||
* Take the array referenced resulting from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ArrayOperatorFactory}.
|
||||
*/
|
||||
public static ArrayOperatorFactory arrayOf(AggregationExpression expression) {
|
||||
return new ArrayOperatorFactory(expression);
|
||||
@@ -123,8 +123,8 @@ public class ArrayOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and returns the element at the
|
||||
* specified array {@literal position}.
|
||||
*
|
||||
* @param position
|
||||
* @return
|
||||
* @param position the element index.
|
||||
* @return new instance of {@link ArrayElemAt}.
|
||||
*/
|
||||
public ArrayElemAt elementAt(int position) {
|
||||
return createArrayElemAt().elementAt(position);
|
||||
@@ -135,7 +135,7 @@ public class ArrayOperators {
|
||||
* resulting form the given {@literal expression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ArrayElemAt}.
|
||||
*/
|
||||
public ArrayElemAt elementAt(AggregationExpression expression) {
|
||||
|
||||
@@ -148,7 +148,7 @@ public class ArrayOperators {
|
||||
* defined by the referenced {@literal field}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ArrayElemAt}.
|
||||
*/
|
||||
public ArrayElemAt elementAt(String fieldReference) {
|
||||
|
||||
@@ -170,7 +170,7 @@ public class ArrayOperators {
|
||||
* {@literal arrayFieldReference} to it.
|
||||
*
|
||||
* @param arrayFieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ConcatArrays}.
|
||||
*/
|
||||
public ConcatArrays concat(String arrayFieldReference) {
|
||||
|
||||
@@ -183,7 +183,7 @@ public class ArrayOperators {
|
||||
* the given {@literal expression} to it.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ConcatArrays}.
|
||||
*/
|
||||
public ConcatArrays concat(AggregationExpression expression) {
|
||||
|
||||
@@ -204,7 +204,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and selects a subset of the array to
|
||||
* return based on the specified condition.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link AsBuilder} to create a {@link Filter}.
|
||||
*/
|
||||
public AsBuilder filter() {
|
||||
|
||||
@@ -219,7 +219,7 @@ public class ArrayOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and an check if its an array.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link IsArray}.
|
||||
*/
|
||||
public IsArray isArray() {
|
||||
|
||||
@@ -231,7 +231,7 @@ public class ArrayOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and retrieves its length.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Size}.
|
||||
*/
|
||||
public Size length() {
|
||||
|
||||
@@ -245,7 +245,7 @@ public class ArrayOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and selects a subset from it.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Slice}.
|
||||
*/
|
||||
public Slice slice() {
|
||||
|
||||
@@ -261,7 +261,7 @@ public class ArrayOperators {
|
||||
* value and returns the array index (zero-based) of the first occurrence.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfArray}.
|
||||
*/
|
||||
public IndexOfArray indexOf(Object value) {
|
||||
|
||||
@@ -276,7 +276,7 @@ public class ArrayOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns an array with the elements in reverse order.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link ReverseArray}.
|
||||
*/
|
||||
public ReverseArray reverse() {
|
||||
|
||||
@@ -293,7 +293,7 @@ public class ArrayOperators {
|
||||
* an array and combines them into a single value.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ReduceInitialValueBuilder} to create {@link Reduce}.
|
||||
*/
|
||||
public ArrayOperatorFactory.ReduceInitialValueBuilder reduce(AggregationExpression expression) {
|
||||
|
||||
@@ -305,8 +305,8 @@ public class ArrayOperators {
|
||||
* Start creating new {@link AggregationExpression} that applies an {@link AggregationExpression} to each element in
|
||||
* an array and combines them into a single value.
|
||||
*
|
||||
* @param expressions
|
||||
* @return
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return new instance of {@link ReduceInitialValueBuilder} to create {@link Reduce}.
|
||||
*/
|
||||
public ArrayOperatorFactory.ReduceInitialValueBuilder reduce(PropertyExpression... expressions) {
|
||||
|
||||
@@ -320,7 +320,7 @@ public class ArrayOperators {
|
||||
* the second input array, etc.
|
||||
*
|
||||
* @param arrays must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Zip}.
|
||||
*/
|
||||
public Zip zipWith(Object... arrays) {
|
||||
|
||||
@@ -336,7 +336,7 @@ public class ArrayOperators {
|
||||
* associated array.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link In}.
|
||||
*/
|
||||
public In containsValue(Object value) {
|
||||
|
||||
@@ -413,7 +413,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link ArrayElemAt}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ArrayElemAt}.
|
||||
*/
|
||||
public static ArrayElemAt arrayOf(String fieldReference) {
|
||||
|
||||
@@ -425,7 +425,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link ArrayElemAt}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ArrayElemAt}.
|
||||
*/
|
||||
public static ArrayElemAt arrayOf(AggregationExpression expression) {
|
||||
|
||||
@@ -446,16 +446,34 @@ public class ArrayOperators {
|
||||
return new ArrayElemAt(Collections.singletonList(values));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the element with given index number.
|
||||
*
|
||||
* @param index the index number
|
||||
* @return new instance of {@link ArrayElemAt}.
|
||||
*/
|
||||
public ArrayElemAt elementAt(int index) {
|
||||
return new ArrayElemAt(append(index));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the element at the index number evaluated from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link ArrayElemAt}.
|
||||
*/
|
||||
public ArrayElemAt elementAt(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
return new ArrayElemAt(append(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the element at the index number traken from the given field.
|
||||
*
|
||||
* @param arrayFieldReference the field name.
|
||||
* @return new instance of {@link ArrayElemAt}.
|
||||
*/
|
||||
public ArrayElemAt elementAt(String arrayFieldReference) {
|
||||
|
||||
Assert.notNull(arrayFieldReference, "ArrayReference must not be null!");
|
||||
@@ -483,7 +501,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link ConcatArrays}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ConcatArrays}.
|
||||
*/
|
||||
public static ConcatArrays arrayOf(String fieldReference) {
|
||||
|
||||
@@ -495,7 +513,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link ConcatArrays}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ConcatArrays}.
|
||||
*/
|
||||
public static ConcatArrays arrayOf(AggregationExpression expression) {
|
||||
|
||||
@@ -516,12 +534,24 @@ public class ArrayOperators {
|
||||
return new ConcatArrays(Collections.singletonList(values));
|
||||
}
|
||||
|
||||
/**
|
||||
* Concat with the array stored at the given field.
|
||||
*
|
||||
* @param arrayFieldReference must not be {@literal null}.
|
||||
* @return new instance of {@link ConcatArrays}.
|
||||
*/
|
||||
public ConcatArrays concat(String arrayFieldReference) {
|
||||
|
||||
Assert.notNull(arrayFieldReference, "ArrayFieldReference must not be null!");
|
||||
return new ConcatArrays(append(Fields.field(arrayFieldReference)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Concat with the array resulting from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link ConcatArrays}.
|
||||
*/
|
||||
public ConcatArrays concat(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
@@ -574,7 +604,7 @@ public class ArrayOperators {
|
||||
* Set the {@literal values} to apply the {@code $filter} to.
|
||||
*
|
||||
* @param values must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link AsBuilder} to create the {@link Filter}.
|
||||
*/
|
||||
public static AsBuilder filter(List<?> values) {
|
||||
|
||||
@@ -651,7 +681,7 @@ public class ArrayOperators {
|
||||
* Set the {@literal variableName} for the elements in the input array.
|
||||
*
|
||||
* @param variableName must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
ConditionBuilder as(String variableName);
|
||||
}
|
||||
@@ -665,7 +695,7 @@ public class ArrayOperators {
|
||||
* Set the {@link AggregationExpression} that determines whether to include the element in the resulting array.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
Filter by(AggregationExpression expression);
|
||||
|
||||
@@ -673,7 +703,7 @@ public class ArrayOperators {
|
||||
* Set the {@literal expression} that determines whether to include the element in the resulting array.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
Filter by(String expression);
|
||||
|
||||
@@ -681,7 +711,7 @@ public class ArrayOperators {
|
||||
* Set the {@literal expression} that determines whether to include the element in the resulting array.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
Filter by(Document expression);
|
||||
}
|
||||
@@ -700,7 +730,7 @@ public class ArrayOperators {
|
||||
/**
|
||||
* Creates new {@link InputBuilder}.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link FilterExpressionBuilder}.
|
||||
*/
|
||||
public static InputBuilder newBuilder() {
|
||||
return new FilterExpressionBuilder();
|
||||
@@ -800,7 +830,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link IsArray}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IsArray}.
|
||||
*/
|
||||
public static IsArray isArray(String fieldReference) {
|
||||
|
||||
@@ -812,7 +842,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link IsArray}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IsArray}.
|
||||
*/
|
||||
public static IsArray isArray(AggregationExpression expression) {
|
||||
|
||||
@@ -841,7 +871,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link Size}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Size}.
|
||||
*/
|
||||
public static Size lengthOfArray(String fieldReference) {
|
||||
|
||||
@@ -853,7 +883,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link Size}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Size}.
|
||||
*/
|
||||
public static Size lengthOfArray(AggregationExpression expression) {
|
||||
|
||||
@@ -895,7 +925,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link Slice}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Slice}.
|
||||
*/
|
||||
public static Slice sliceArrayOf(String fieldReference) {
|
||||
|
||||
@@ -907,7 +937,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link Slice}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Slice}.
|
||||
*/
|
||||
public static Slice sliceArrayOf(AggregationExpression expression) {
|
||||
|
||||
@@ -928,10 +958,22 @@ public class ArrayOperators {
|
||||
return new Slice(Collections.singletonList(values));
|
||||
}
|
||||
|
||||
/**
|
||||
* Slice the number of elements.
|
||||
*
|
||||
* @param nrElements elements to slice.
|
||||
* @return new instance of {@link Slice}.
|
||||
*/
|
||||
public Slice itemCount(int nrElements) {
|
||||
return new Slice(append(nrElements));
|
||||
}
|
||||
|
||||
/**
|
||||
* Slice using offset and count.
|
||||
*
|
||||
* @param position the start position
|
||||
* @return new instance of {@link SliceElementsBuilder} to create {@link Slice}.
|
||||
*/
|
||||
public SliceElementsBuilder offset(final int position) {
|
||||
|
||||
return new SliceElementsBuilder() {
|
||||
@@ -978,7 +1020,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link IndexOfArray}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfArray}.
|
||||
*/
|
||||
public static IndexOfArrayBuilder arrayOf(String fieldReference) {
|
||||
|
||||
@@ -990,7 +1032,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link IndexOfArray}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfArray}.
|
||||
*/
|
||||
public static IndexOfArrayBuilder arrayOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1002,7 +1044,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link IndexOfArray}.
|
||||
*
|
||||
* @param values must not be {@literal null}.
|
||||
* @return new instance of {@link IndexOfArray}.
|
||||
* @return new instance of {@link IndexOfArrayBuilder} to create {@link IndexOfArray}.
|
||||
* @since 2.2
|
||||
*/
|
||||
public static IndexOfArrayBuilder arrayOf(Collection<?> values) {
|
||||
@@ -1011,6 +1053,12 @@ public class ArrayOperators {
|
||||
return new IndexOfArrayBuilder(values);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup within a given range.
|
||||
*
|
||||
* @param range the lookup range.
|
||||
* @return new instance of {@link IndexOfArray}.
|
||||
*/
|
||||
public IndexOfArray within(Range<Long> range) {
|
||||
return new IndexOfArray(append(AggregationUtils.toRangeValues(range)));
|
||||
}
|
||||
@@ -1030,7 +1078,7 @@ public class ArrayOperators {
|
||||
* Set the {@literal value} to check for its index in the array.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfArray}.
|
||||
*/
|
||||
public IndexOfArray indexOf(Object value) {
|
||||
|
||||
@@ -1060,7 +1108,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link RangeOperator}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link RangeOperatorBuilder} to create {@link RangeOperator}.
|
||||
*/
|
||||
public static RangeOperatorBuilder rangeStartingAt(String fieldReference) {
|
||||
return new RangeOperatorBuilder(Fields.field(fieldReference));
|
||||
@@ -1070,7 +1118,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link RangeOperator}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link RangeOperatorBuilder} to create {@link RangeOperator}.
|
||||
*/
|
||||
public static RangeOperatorBuilder rangeStartingAt(AggregationExpression expression) {
|
||||
return new RangeOperatorBuilder(expression);
|
||||
@@ -1080,7 +1128,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link RangeOperator}.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @return new instance of {@link RangeOperator}.
|
||||
*/
|
||||
public static RangeOperatorBuilder rangeStartingAt(long value) {
|
||||
return new RangeOperatorBuilder(value);
|
||||
@@ -1102,7 +1150,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link RangeOperator}.
|
||||
*
|
||||
* @param index
|
||||
* @return
|
||||
* @return new instance of {@link RangeOperator}.
|
||||
*/
|
||||
public RangeOperator to(long index) {
|
||||
return new RangeOperator(Arrays.asList(startPoint, index));
|
||||
@@ -1112,7 +1160,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link RangeOperator}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link RangeOperator}.
|
||||
*/
|
||||
public RangeOperator to(AggregationExpression expression) {
|
||||
return new RangeOperator(Arrays.asList(startPoint, expression));
|
||||
@@ -1122,7 +1170,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link RangeOperator}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link RangeOperator}.
|
||||
*/
|
||||
public RangeOperator to(String fieldReference) {
|
||||
return new RangeOperator(Arrays.asList(startPoint, Fields.field(fieldReference)));
|
||||
@@ -1150,7 +1198,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link ReverseArray} given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ReverseArray}.
|
||||
*/
|
||||
public static ReverseArray reverseArrayOf(String fieldReference) {
|
||||
return new ReverseArray(Fields.field(fieldReference));
|
||||
@@ -1160,7 +1208,7 @@ public class ArrayOperators {
|
||||
* Creates new {@link ReverseArray} given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ReverseArray}.
|
||||
*/
|
||||
public static ReverseArray reverseArrayOf(AggregationExpression expression) {
|
||||
return new ReverseArray(expression);
|
||||
@@ -1239,7 +1287,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link Reduce}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link InitialValueBuilder} to create {@link Reduce}.
|
||||
*/
|
||||
public static InitialValueBuilder arrayOf(final String fieldReference) {
|
||||
|
||||
@@ -1267,7 +1315,7 @@ public class ArrayOperators {
|
||||
Assert.notNull(expressions, "PropertyExpressions must not be null");
|
||||
|
||||
return new Reduce(Fields.field(fieldReference), initialValue,
|
||||
Arrays.<AggregationExpression> asList(expressions));
|
||||
Arrays.<AggregationExpression>asList(expressions));
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1278,7 +1326,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link Reduce}.
|
||||
*
|
||||
* @param arrayValueExpression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link InitialValueBuilder} to create {@link Reduce}.
|
||||
*/
|
||||
public static InitialValueBuilder arrayOf(final AggregationExpression arrayValueExpression) {
|
||||
|
||||
@@ -1318,7 +1366,7 @@ public class ArrayOperators {
|
||||
* Define the initial cumulative value set before in is applied to the first element of the input array.
|
||||
*
|
||||
* @param initialValue must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
ReduceBuilder withInitialValue(Object initialValue);
|
||||
}
|
||||
@@ -1335,7 +1383,7 @@ public class ArrayOperators {
|
||||
* {@link Variable#VALUE} are available.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Reduce}.
|
||||
*/
|
||||
Reduce reduce(AggregationExpression expression);
|
||||
|
||||
@@ -1346,7 +1394,7 @@ public class ArrayOperators {
|
||||
* {@link Variable#VALUE} are available.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Reduce}.
|
||||
*/
|
||||
Reduce reduce(PropertyExpression... expressions);
|
||||
}
|
||||
@@ -1372,7 +1420,7 @@ public class ArrayOperators {
|
||||
* Define a result property for an {@link AggregationExpression} used in {@link Reduce}.
|
||||
*
|
||||
* @param name must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link AsBuilder} to create {@link Reduce}.
|
||||
*/
|
||||
public static AsBuilder property(final String name) {
|
||||
|
||||
@@ -1402,7 +1450,7 @@ public class ArrayOperators {
|
||||
* Set the {@link AggregationExpression} resulting in the properties value.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
PropertyExpression definedAs(AggregationExpression expression);
|
||||
}
|
||||
@@ -1459,7 +1507,7 @@ public class ArrayOperators {
|
||||
* eg. {@code $$value.product}
|
||||
*
|
||||
* @param property must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Field referringTo(final String property) {
|
||||
|
||||
@@ -1508,7 +1556,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link Zip}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ZipBuilder} to create {@link Zip}.
|
||||
*/
|
||||
public static ZipBuilder arrayOf(String fieldReference) {
|
||||
|
||||
@@ -1520,7 +1568,7 @@ public class ArrayOperators {
|
||||
* Start creating new {@link Zip}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ZipBuilder} to create {@link Zip}.
|
||||
*/
|
||||
public static ZipBuilder arrayOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1544,7 +1592,7 @@ public class ArrayOperators {
|
||||
/**
|
||||
* Create new {@link Zip} and set the {@code useLongestLength} property to {@literal true}.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Zip}.
|
||||
*/
|
||||
public Zip useLongestLength() {
|
||||
return new Zip(append("useLongestLength", true));
|
||||
@@ -1554,7 +1602,7 @@ public class ArrayOperators {
|
||||
* Optionally provide a default value.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Zip}.
|
||||
*/
|
||||
public Zip defaultTo(String fieldReference) {
|
||||
|
||||
@@ -1566,7 +1614,7 @@ public class ArrayOperators {
|
||||
* Optionally provide a default value.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Zip}.
|
||||
*/
|
||||
public Zip defaultTo(AggregationExpression expression) {
|
||||
|
||||
@@ -1578,7 +1626,7 @@ public class ArrayOperators {
|
||||
* Optionally provide a default value.
|
||||
*
|
||||
* @param array must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Zip}.
|
||||
*/
|
||||
public Zip defaultTo(Object[] array) {
|
||||
|
||||
@@ -1602,7 +1650,7 @@ public class ArrayOperators {
|
||||
* array, etc.
|
||||
*
|
||||
* @param arrays arrays to zip the referenced one with. must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Zip}.
|
||||
*/
|
||||
public Zip zip(Object... arrays) {
|
||||
|
||||
@@ -1616,7 +1664,7 @@ public class ArrayOperators {
|
||||
}
|
||||
}
|
||||
|
||||
return new Zip(Collections.<String, Object> singletonMap("inputs", sourceArrays));
|
||||
return new Zip(Collections.<String, Object>singletonMap("inputs", sourceArrays));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1627,7 +1675,7 @@ public class ArrayOperators {
|
||||
* @author Christoph Strobl
|
||||
* @author Shashank Sharma
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.com/manual/reference/operator/aggregation/in/">https://docs.mongodb.com/manual/reference/operator/aggregation/in/</a>
|
||||
* "https://docs.mongodb.com/manual/reference/operator/aggregation/in/">https://docs.mongodb.com/manual/reference/operator/aggregation/in/</a>
|
||||
* @since 2.2
|
||||
*/
|
||||
public static class In extends AbstractAggregationExpression {
|
||||
@@ -1645,7 +1693,7 @@ public class ArrayOperators {
|
||||
* Start creating {@link In}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link InBuilder} to create {@link In}.
|
||||
*/
|
||||
public static InBuilder arrayOf(String fieldReference) {
|
||||
|
||||
@@ -1662,7 +1710,7 @@ public class ArrayOperators {
|
||||
* Start creating {@link In}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link InBuilder} to create {@link In}.
|
||||
*/
|
||||
public static InBuilder arrayOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1704,7 +1752,7 @@ public class ArrayOperators {
|
||||
* Set the {@literal value} to check for existence in the array.
|
||||
*
|
||||
* @param value must not be {@literal value}.
|
||||
* @return
|
||||
* @return new instance of {@link In}.
|
||||
*/
|
||||
In containsValue(Object value);
|
||||
}
|
||||
@@ -1716,7 +1764,7 @@ public class ArrayOperators {
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.com/manual/reference/operator/aggregation/arrayToObject/">https://docs.mongodb.com/manual/reference/operator/aggregation/arrayToObject/</a>
|
||||
* "https://docs.mongodb.com/manual/reference/operator/aggregation/arrayToObject/">https://docs.mongodb.com/manual/reference/operator/aggregation/arrayToObject/</a>
|
||||
* @since 2.1
|
||||
*/
|
||||
public static class ArrayToObject extends AbstractAggregationExpression {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class BooleanOperators {
|
||||
* Take the array referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link BooleanOperatorFactory}.
|
||||
*/
|
||||
public static BooleanOperatorFactory valueOf(String fieldReference) {
|
||||
return new BooleanOperatorFactory(fieldReference);
|
||||
@@ -44,7 +44,7 @@ public class BooleanOperators {
|
||||
* Take the value resulting of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link BooleanOperatorFactory}.
|
||||
*/
|
||||
public static BooleanOperatorFactory valueOf(AggregationExpression fieldReference) {
|
||||
return new BooleanOperatorFactory(fieldReference);
|
||||
@@ -55,7 +55,7 @@ public class BooleanOperators {
|
||||
* opposite boolean value.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Not}.
|
||||
*/
|
||||
public static Not not(String fieldReference) {
|
||||
return Not.not(fieldReference);
|
||||
@@ -66,7 +66,7 @@ public class BooleanOperators {
|
||||
* and returns the opposite boolean value.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Not}.
|
||||
*/
|
||||
public static Not not(AggregationExpression expression) {
|
||||
return Not.not(expression);
|
||||
@@ -109,7 +109,7 @@ public class BooleanOperators {
|
||||
* all of the expressions are {@literal true}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link And}.
|
||||
*/
|
||||
public And and(AggregationExpression expression) {
|
||||
|
||||
@@ -122,7 +122,7 @@ public class BooleanOperators {
|
||||
* all of the expressions are {@literal true}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link And}.
|
||||
*/
|
||||
public And and(String fieldReference) {
|
||||
|
||||
@@ -139,7 +139,7 @@ public class BooleanOperators {
|
||||
* any of the expressions are {@literal true}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Or}.
|
||||
*/
|
||||
public Or or(AggregationExpression expression) {
|
||||
|
||||
@@ -152,7 +152,7 @@ public class BooleanOperators {
|
||||
* any of the expressions are {@literal true}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Or}.
|
||||
*/
|
||||
public Or or(String fieldReference) {
|
||||
|
||||
@@ -167,7 +167,7 @@ public class BooleanOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that evaluates a boolean and returns the opposite boolean value.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Not}.
|
||||
*/
|
||||
public Not not() {
|
||||
return usesFieldRef() ? Not.not(fieldReference) : Not.not(expression);
|
||||
@@ -198,8 +198,8 @@ public class BooleanOperators {
|
||||
* Creates new {@link And} that evaluates one or more expressions and returns {@literal true} if all of the
|
||||
* expressions are {@literal true}.
|
||||
*
|
||||
* @param expressions
|
||||
* @return
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return new instance of {@link And}.
|
||||
*/
|
||||
public static And and(Object... expressions) {
|
||||
return new And(Arrays.asList(expressions));
|
||||
@@ -209,7 +209,7 @@ public class BooleanOperators {
|
||||
* Creates new {@link And} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link And}.
|
||||
*/
|
||||
public And andExpression(AggregationExpression expression) {
|
||||
|
||||
@@ -221,7 +221,7 @@ public class BooleanOperators {
|
||||
* Creates new {@link And} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link And}.
|
||||
*/
|
||||
public And andField(String fieldReference) {
|
||||
|
||||
@@ -233,7 +233,7 @@ public class BooleanOperators {
|
||||
* Creates new {@link And} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link And}.
|
||||
*/
|
||||
public And andValue(Object value) {
|
||||
|
||||
@@ -263,7 +263,7 @@ public class BooleanOperators {
|
||||
* expressions are {@literal true}.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Or}.
|
||||
*/
|
||||
public static Or or(Object... expressions) {
|
||||
|
||||
@@ -275,7 +275,7 @@ public class BooleanOperators {
|
||||
* Creates new {@link Or} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Or}.
|
||||
*/
|
||||
public Or orExpression(AggregationExpression expression) {
|
||||
|
||||
@@ -287,7 +287,7 @@ public class BooleanOperators {
|
||||
* Creates new {@link Or} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Or}.
|
||||
*/
|
||||
public Or orField(String fieldReference) {
|
||||
|
||||
@@ -299,7 +299,7 @@ public class BooleanOperators {
|
||||
* Creates new {@link Or} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Or}.
|
||||
*/
|
||||
public Or orValue(Object value) {
|
||||
|
||||
@@ -329,7 +329,7 @@ public class BooleanOperators {
|
||||
* value.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Not}.
|
||||
*/
|
||||
public static Not not(String fieldReference) {
|
||||
|
||||
@@ -342,7 +342,7 @@ public class BooleanOperators {
|
||||
* returns the opposite boolean value.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Not}.
|
||||
*/
|
||||
public static Not not(AggregationExpression expression) {
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat
|
||||
* Configures a number of bucket {@literal buckets} and return a new {@link BucketAutoOperation}.
|
||||
*
|
||||
* @param buckets must be a positive number.
|
||||
* @return
|
||||
* @return new instance of {@link BucketAutoOperation}.
|
||||
*/
|
||||
public BucketAutoOperation withBuckets(int buckets) {
|
||||
|
||||
@@ -128,7 +128,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat
|
||||
* Use either predefined {@link Granularities} or provide a own one.
|
||||
*
|
||||
* @param granularity must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link BucketAutoOperation}.
|
||||
*/
|
||||
public BucketAutoOperation withGranularity(Granularity granularity) {
|
||||
|
||||
@@ -209,7 +209,7 @@ public class BucketAutoOperation extends BucketOperationSupport<BucketAutoOperat
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @param operation must not be {@literal null}.
|
||||
* @param parameters
|
||||
* @param parameters must not be {@literal null}.
|
||||
*/
|
||||
protected ExpressionBucketAutoOperationBuilder(String expression, BucketAutoOperation operation,
|
||||
Object[] parameters) {
|
||||
|
||||
@@ -110,7 +110,7 @@ public class BucketOperation extends BucketOperationSupport<BucketOperation, Buc
|
||||
* Configures a default bucket {@literal literal} and return a new {@link BucketOperation}.
|
||||
*
|
||||
* @param literal must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link BucketOperation}.
|
||||
*/
|
||||
public BucketOperation withDefaultBucket(Object literal) {
|
||||
|
||||
@@ -123,7 +123,7 @@ public class BucketOperation extends BucketOperationSupport<BucketOperation, Buc
|
||||
* preserved and the new {@literal boundaries} are appended.
|
||||
*
|
||||
* @param boundaries must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link BucketOperation}.
|
||||
*/
|
||||
public BucketOperation withBoundaries(Object... boundaries) {
|
||||
|
||||
@@ -209,7 +209,7 @@ public class BucketOperation extends BucketOperationSupport<BucketOperation, Buc
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @param operation must not be {@literal null}.
|
||||
* @param parameters
|
||||
* @param parameters must not be {@literal null}.
|
||||
*/
|
||||
protected ExpressionBucketOperationBuilder(String expression, BucketOperation operation, Object[] parameters) {
|
||||
super(expression, operation, parameters);
|
||||
|
||||
@@ -21,14 +21,13 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.bson.Document;
|
||||
import org.springframework.data.mongodb.core.aggregation.BucketOperationSupport.OutputBuilder;
|
||||
import org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedField;
|
||||
import org.springframework.data.mongodb.core.aggregation.ProjectionOperation.ProjectionOperationBuilder;
|
||||
import org.springframework.expression.spel.ast.Projection;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import org.bson.Document;
|
||||
|
||||
/**
|
||||
* Base class for bucket operations that support output expressions the aggregation framework. <br />
|
||||
* Bucket stages collect documents into buckets and can contribute output fields. <br />
|
||||
@@ -104,7 +103,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
*
|
||||
* @param expression the SpEL expression, must not be {@literal null} or empty.
|
||||
* @param params must not be {@literal null}
|
||||
* @return
|
||||
* @return new instance of {@link ExpressionBucketOperationBuilderSupport} to create {@link BucketOperation}.
|
||||
*/
|
||||
public abstract ExpressionBucketOperationBuilderSupport<B, T> andOutputExpression(String expression,
|
||||
Object... params);
|
||||
@@ -114,7 +113,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
* resulting bucket documents.
|
||||
*
|
||||
* @param expression the SpEL expression, must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public abstract B andOutput(AggregationExpression expression);
|
||||
|
||||
@@ -124,14 +123,14 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
* {@literal fieldName}.
|
||||
*
|
||||
* @param fieldName must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public abstract B andOutput(String fieldName);
|
||||
|
||||
/**
|
||||
* Creates a new {@link BucketOperationSupport} given to add a count field to the resulting bucket documents.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B andOutputCount() {
|
||||
return andOutput(new AggregationExpression() {
|
||||
@@ -231,7 +230,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
* Generates a builder for a {@code $sum}-expression. <br />
|
||||
* Count expressions are emulated via {@code $sum: 1}.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B count() {
|
||||
return sum(1);
|
||||
@@ -240,7 +239,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Generates a builder for a {@code $sum}-expression for the current value.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B sum() {
|
||||
return apply(Accumulators.SUM);
|
||||
@@ -249,8 +248,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Generates a builder for a {@code $sum}-expression for the given {@literal value}.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @param value must not be {@literal null}.
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B sum(Number value) {
|
||||
return apply(new OperationOutput(Accumulators.SUM.getMongoOperator(), Collections.singleton(value)));
|
||||
@@ -259,7 +258,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Generates a builder for an {@code $last}-expression for the current value..
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B last() {
|
||||
return apply(Accumulators.LAST);
|
||||
@@ -268,7 +267,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Generates a builder for a {@code $first}-expression the current value.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B first() {
|
||||
return apply(Accumulators.FIRST);
|
||||
@@ -277,8 +276,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Generates a builder for an {@code $avg}-expression for the current value.
|
||||
*
|
||||
* @param reference
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B avg() {
|
||||
return apply(Accumulators.AVG);
|
||||
@@ -287,7 +285,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Generates a builder for an {@code $min}-expression for the current value.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B min() {
|
||||
return apply(Accumulators.MIN);
|
||||
@@ -296,7 +294,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Generates a builder for an {@code $max}-expression for the current value.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B max() {
|
||||
return apply(Accumulators.MAX);
|
||||
@@ -305,7 +303,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Generates a builder for an {@code $push}-expression for the current value.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B push() {
|
||||
return apply(Accumulators.PUSH);
|
||||
@@ -314,7 +312,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Generates a builder for an {@code $addToSet}-expression for the current value.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B addToSet() {
|
||||
return apply(Accumulators.ADDTOSET);
|
||||
@@ -325,7 +323,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
*
|
||||
* @param operation the operation name, must not be {@literal null} or empty.
|
||||
* @param values must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public B apply(String operation, Object... values) {
|
||||
|
||||
@@ -342,7 +340,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
* Apply an {@link OperationOutput} to this output.
|
||||
*
|
||||
* @param operationOutput must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
protected abstract B apply(OperationOutput operationOutput);
|
||||
|
||||
@@ -354,7 +352,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
* Returns the finally to be applied {@link BucketOperation} with the given alias.
|
||||
*
|
||||
* @param alias will never be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public T as(String alias) {
|
||||
|
||||
@@ -550,8 +548,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
public Document toDocument(AggregationOperationContext context) {
|
||||
|
||||
List<Object> operationArguments = getOperationArguments(context);
|
||||
return new Document(operation,
|
||||
operationArguments.size() == 1 ? operationArguments.get(0) : operationArguments);
|
||||
return new Document(operation, operationArguments.size() == 1 ? operationArguments.get(0) : operationArguments);
|
||||
}
|
||||
|
||||
protected List<Object> getOperationArguments(AggregationOperationContext context) {
|
||||
@@ -579,7 +576,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Returns the field that holds the {@link ProjectionOperationBuilder.OperationProjection}.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
protected Field getField() {
|
||||
return getExposedField();
|
||||
@@ -589,7 +586,7 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
* Creates a new instance of this {@link OperationOutput} with the given alias.
|
||||
*
|
||||
* @param alias the alias to set
|
||||
* @return
|
||||
* @return new instance of {@link OperationOutput}.
|
||||
*/
|
||||
public OperationOutput withAlias(String alias) {
|
||||
|
||||
@@ -658,8 +655,8 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
|
||||
/**
|
||||
* Creates a new {@link AggregationExpressionOutput}.
|
||||
*
|
||||
* @param field
|
||||
* @param expression
|
||||
* @param field must not be {@literal null}.
|
||||
* @param expression must not be {@literal null}.
|
||||
*/
|
||||
protected AggregationExpressionOutput(Field field, AggregationExpression expression) {
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ComparisonOperators {
|
||||
* Take the field referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ComparisonOperatorFactory}.
|
||||
*/
|
||||
public static ComparisonOperatorFactory valueOf(String fieldReference) {
|
||||
return new ComparisonOperatorFactory(fieldReference);
|
||||
@@ -42,7 +42,7 @@ public class ComparisonOperators {
|
||||
* Take the value resulting from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ComparisonOperatorFactory}.
|
||||
*/
|
||||
public static ComparisonOperatorFactory valueOf(AggregationExpression expression) {
|
||||
return new ComparisonOperatorFactory(expression);
|
||||
@@ -81,7 +81,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link AggregationExpression} that compares two values.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Cmp}.
|
||||
*/
|
||||
public Cmp compareTo(String fieldReference) {
|
||||
return createCmp().compareTo(fieldReference);
|
||||
@@ -91,7 +91,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link AggregationExpression} that compares two values.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Cmp}.
|
||||
*/
|
||||
public Cmp compareTo(AggregationExpression expression) {
|
||||
return createCmp().compareTo(expression);
|
||||
@@ -101,7 +101,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link AggregationExpression} that compares two values.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Cmp}.
|
||||
*/
|
||||
public Cmp compareToValue(Object value) {
|
||||
return createCmp().compareToValue(value);
|
||||
@@ -116,7 +116,7 @@ public class ComparisonOperators {
|
||||
* value is equal to the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Eq}.
|
||||
*/
|
||||
public Eq equalTo(String fieldReference) {
|
||||
return createEq().equalTo(fieldReference);
|
||||
@@ -127,7 +127,7 @@ public class ComparisonOperators {
|
||||
* value is equal to the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Eq}.
|
||||
*/
|
||||
public Eq equalTo(AggregationExpression expression) {
|
||||
return createEq().equalTo(expression);
|
||||
@@ -138,7 +138,7 @@ public class ComparisonOperators {
|
||||
* value is equal to the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Eq}.
|
||||
*/
|
||||
public Eq equalToValue(Object value) {
|
||||
return createEq().equalToValue(value);
|
||||
@@ -153,7 +153,7 @@ public class ComparisonOperators {
|
||||
* value is greater than the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gt}.
|
||||
*/
|
||||
public Gt greaterThan(String fieldReference) {
|
||||
return createGt().greaterThan(fieldReference);
|
||||
@@ -164,7 +164,7 @@ public class ComparisonOperators {
|
||||
* value is greater than the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gt}.
|
||||
*/
|
||||
public Gt greaterThan(AggregationExpression expression) {
|
||||
return createGt().greaterThan(expression);
|
||||
@@ -175,7 +175,7 @@ public class ComparisonOperators {
|
||||
* value is greater than the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gt}.
|
||||
*/
|
||||
public Gt greaterThanValue(Object value) {
|
||||
return createGt().greaterThanValue(value);
|
||||
@@ -190,7 +190,7 @@ public class ComparisonOperators {
|
||||
* value is greater than or equivalent to the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gte}.
|
||||
*/
|
||||
public Gte greaterThanEqualTo(String fieldReference) {
|
||||
return createGte().greaterThanEqualTo(fieldReference);
|
||||
@@ -201,7 +201,7 @@ public class ComparisonOperators {
|
||||
* value is greater than or equivalent to the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gte}.
|
||||
*/
|
||||
public Gte greaterThanEqualTo(AggregationExpression expression) {
|
||||
return createGte().greaterThanEqualTo(expression);
|
||||
@@ -212,7 +212,7 @@ public class ComparisonOperators {
|
||||
* value is greater than or equivalent to the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gte}.
|
||||
*/
|
||||
public Gte greaterThanEqualToValue(Object value) {
|
||||
return createGte().greaterThanEqualToValue(value);
|
||||
@@ -227,7 +227,7 @@ public class ComparisonOperators {
|
||||
* value is less than the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lt}.
|
||||
*/
|
||||
public Lt lessThan(String fieldReference) {
|
||||
return createLt().lessThan(fieldReference);
|
||||
@@ -238,7 +238,7 @@ public class ComparisonOperators {
|
||||
* value is less than the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lt}.
|
||||
*/
|
||||
public Lt lessThan(AggregationExpression expression) {
|
||||
return createLt().lessThan(expression);
|
||||
@@ -249,7 +249,7 @@ public class ComparisonOperators {
|
||||
* value is less than to the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lt}.
|
||||
*/
|
||||
public Lt lessThanValue(Object value) {
|
||||
return createLt().lessThanValue(value);
|
||||
@@ -264,7 +264,7 @@ public class ComparisonOperators {
|
||||
* value is less than or equivalent to the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lte}.
|
||||
*/
|
||||
public Lte lessThanEqualTo(String fieldReference) {
|
||||
return createLte().lessThanEqualTo(fieldReference);
|
||||
@@ -275,7 +275,7 @@ public class ComparisonOperators {
|
||||
* value is less than or equivalent to the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lte}.
|
||||
*/
|
||||
public Lte lessThanEqualTo(AggregationExpression expression) {
|
||||
return createLte().lessThanEqualTo(expression);
|
||||
@@ -285,8 +285,8 @@ public class ComparisonOperators {
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is less than or equivalent to the given value.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Lte}.
|
||||
*/
|
||||
public Lte lessThanEqualToValue(Object value) {
|
||||
return createLte().lessThanEqualToValue(value);
|
||||
@@ -301,7 +301,7 @@ public class ComparisonOperators {
|
||||
* are not equivalent.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ne}.
|
||||
*/
|
||||
public Ne notEqualTo(String fieldReference) {
|
||||
return createNe().notEqualTo(fieldReference);
|
||||
@@ -312,7 +312,7 @@ public class ComparisonOperators {
|
||||
* are not equivalent.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ne}.
|
||||
*/
|
||||
public Ne notEqualTo(AggregationExpression expression) {
|
||||
return createNe().notEqualTo(expression);
|
||||
@@ -323,7 +323,7 @@ public class ComparisonOperators {
|
||||
* are not equivalent.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ne}.
|
||||
*/
|
||||
public Ne notEqualToValue(Object value) {
|
||||
return createNe().notEqualToValue(value);
|
||||
@@ -358,7 +358,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Cmp}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Cmp}.
|
||||
*/
|
||||
public static Cmp valueOf(String fieldReference) {
|
||||
|
||||
@@ -370,7 +370,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Cmp}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Cmp}.
|
||||
*/
|
||||
public static Cmp valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -382,7 +382,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Cmp} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Cmp}.
|
||||
*/
|
||||
public Cmp compareTo(String fieldReference) {
|
||||
|
||||
@@ -394,7 +394,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Cmp} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Cmp}.
|
||||
*/
|
||||
public Cmp compareTo(AggregationExpression expression) {
|
||||
|
||||
@@ -406,7 +406,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Cmp} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Cmp}.
|
||||
*/
|
||||
public Cmp compareToValue(Object value) {
|
||||
|
||||
@@ -435,7 +435,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Eq}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Eq}.
|
||||
*/
|
||||
public static Eq valueOf(String fieldReference) {
|
||||
|
||||
@@ -447,7 +447,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Eq}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Eq}.
|
||||
*/
|
||||
public static Eq valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -459,7 +459,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Eq} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Eq}.
|
||||
*/
|
||||
public Eq equalTo(String fieldReference) {
|
||||
|
||||
@@ -471,7 +471,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Eq} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Eq}.
|
||||
*/
|
||||
public Eq equalTo(AggregationExpression expression) {
|
||||
|
||||
@@ -483,7 +483,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Eq} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Eq}.
|
||||
*/
|
||||
public Eq equalToValue(Object value) {
|
||||
|
||||
@@ -512,7 +512,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gt}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gt}.
|
||||
*/
|
||||
public static Gt valueOf(String fieldReference) {
|
||||
|
||||
@@ -524,7 +524,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gt}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gt}.
|
||||
*/
|
||||
public static Gt valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -536,7 +536,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gt} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gt}.
|
||||
*/
|
||||
public Gt greaterThan(String fieldReference) {
|
||||
|
||||
@@ -548,7 +548,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gt} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gt}.
|
||||
*/
|
||||
public Gt greaterThan(AggregationExpression expression) {
|
||||
|
||||
@@ -560,7 +560,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gt} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gt}.
|
||||
*/
|
||||
public Gt greaterThanValue(Object value) {
|
||||
|
||||
@@ -589,7 +589,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lt}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lt}.
|
||||
*/
|
||||
public static Lt valueOf(String fieldReference) {
|
||||
|
||||
@@ -601,7 +601,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lt}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lt}.
|
||||
*/
|
||||
public static Lt valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -613,7 +613,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lt} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lt}.
|
||||
*/
|
||||
public Lt lessThan(String fieldReference) {
|
||||
|
||||
@@ -625,7 +625,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lt} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lt}.
|
||||
*/
|
||||
public Lt lessThan(AggregationExpression expression) {
|
||||
|
||||
@@ -637,7 +637,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lt} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lt}.
|
||||
*/
|
||||
public Lt lessThanValue(Object value) {
|
||||
|
||||
@@ -666,7 +666,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gte}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gte}.
|
||||
*/
|
||||
public static Gte valueOf(String fieldReference) {
|
||||
|
||||
@@ -678,7 +678,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gte}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gte}.
|
||||
*/
|
||||
public static Gte valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -690,7 +690,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gte} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gte}.
|
||||
*/
|
||||
public Gte greaterThanEqualTo(String fieldReference) {
|
||||
|
||||
@@ -702,7 +702,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gte} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gte}.
|
||||
*/
|
||||
public Gte greaterThanEqualTo(AggregationExpression expression) {
|
||||
|
||||
@@ -714,7 +714,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Gte} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Gte}.
|
||||
*/
|
||||
public Gte greaterThanEqualToValue(Object value) {
|
||||
|
||||
@@ -743,7 +743,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lte}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lte}.
|
||||
*/
|
||||
public static Lte valueOf(String fieldReference) {
|
||||
|
||||
@@ -755,7 +755,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lte}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lte}.
|
||||
*/
|
||||
public static Lte valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -767,7 +767,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lte} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lte}.
|
||||
*/
|
||||
public Lte lessThanEqualTo(String fieldReference) {
|
||||
|
||||
@@ -779,7 +779,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lte} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lte}.
|
||||
*/
|
||||
public Lte lessThanEqualTo(AggregationExpression expression) {
|
||||
|
||||
@@ -791,7 +791,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Lte} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Lte}.
|
||||
*/
|
||||
public Lte lessThanEqualToValue(Object value) {
|
||||
|
||||
@@ -820,7 +820,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Ne}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ne}.
|
||||
*/
|
||||
public static Ne valueOf(String fieldReference) {
|
||||
|
||||
@@ -832,7 +832,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Ne}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ne}.
|
||||
*/
|
||||
public static Ne valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -844,7 +844,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Ne} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ne}.
|
||||
*/
|
||||
public Ne notEqualTo(String fieldReference) {
|
||||
|
||||
@@ -856,7 +856,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Ne} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ne}.
|
||||
*/
|
||||
public Ne notEqualTo(AggregationExpression expression) {
|
||||
|
||||
@@ -868,7 +868,7 @@ public class ComparisonOperators {
|
||||
* Creates new {@link Eq} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Ne}.
|
||||
*/
|
||||
public Ne notEqualToValue(Object value) {
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ConditionalOperators {
|
||||
* Take the field referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ConditionalOperatorFactory}.
|
||||
*/
|
||||
public static ConditionalOperatorFactory when(String fieldReference) {
|
||||
return new ConditionalOperatorFactory(fieldReference);
|
||||
@@ -53,7 +53,7 @@ public class ConditionalOperators {
|
||||
* Take the value resulting from the given {@literal expression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ConditionalOperatorFactory}.
|
||||
*/
|
||||
public static ConditionalOperatorFactory when(AggregationExpression expression) {
|
||||
return new ConditionalOperatorFactory(expression);
|
||||
@@ -63,7 +63,7 @@ public class ConditionalOperators {
|
||||
* Take the value resulting from the given {@literal criteriaDefinition}.
|
||||
*
|
||||
* @param criteriaDefinition must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ConditionalOperatorFactory}.
|
||||
*/
|
||||
public static ConditionalOperatorFactory when(CriteriaDefinition criteriaDefinition) {
|
||||
return new ConditionalOperatorFactory(criteriaDefinition);
|
||||
@@ -75,7 +75,7 @@ public class ConditionalOperators {
|
||||
* instances of undefined values or missing fields, returns the value of the replacement expression.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IfNull.ThenBuilder} to create {@link IfNull}.
|
||||
*/
|
||||
public static IfNull.ThenBuilder ifNull(String fieldReference) {
|
||||
|
||||
@@ -89,7 +89,7 @@ public class ConditionalOperators {
|
||||
* instances of undefined values or missing fields, returns the value of the replacement expression.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IfNull.ThenBuilder} to create {@link IfNull}.
|
||||
*/
|
||||
public static IfNull.ThenBuilder ifNull(AggregationExpression expression) {
|
||||
|
||||
@@ -103,7 +103,7 @@ public class ConditionalOperators {
|
||||
* out of the control flow.
|
||||
*
|
||||
* @param conditions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Switch}.
|
||||
*/
|
||||
public static Switch switchCases(CaseOperator... conditions) {
|
||||
return Switch.switchCases(conditions);
|
||||
@@ -115,7 +115,7 @@ public class ConditionalOperators {
|
||||
* out of the control flow.
|
||||
*
|
||||
* @param conditions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Switch}.
|
||||
*/
|
||||
public static Switch switchCases(List<CaseOperator> conditions) {
|
||||
return Switch.switchCases(conditions);
|
||||
@@ -176,7 +176,7 @@ public class ConditionalOperators {
|
||||
* return expressions.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link OtherwiseBuilder} to create {@link Cond}.
|
||||
*/
|
||||
public OtherwiseBuilder then(Object value) {
|
||||
|
||||
@@ -189,7 +189,7 @@ public class ConditionalOperators {
|
||||
* return expressions.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link OtherwiseBuilder} to create {@link Cond}.
|
||||
*/
|
||||
public OtherwiseBuilder thenValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -202,7 +202,7 @@ public class ConditionalOperators {
|
||||
* return expressions.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link OtherwiseBuilder} to create {@link Cond}.
|
||||
*/
|
||||
public OtherwiseBuilder thenValueOf(String fieldReference) {
|
||||
|
||||
@@ -233,9 +233,9 @@ public class ConditionalOperators {
|
||||
* field references}, {@link AggregationExpression expressions}, values of simple MongoDB types or values that can be
|
||||
* converted to a simple MongoDB type.
|
||||
*
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.com/manual/reference/operator/aggregation/ifNull/">https://docs.mongodb.com/manual/reference/operator/aggregation/ifNull/</a>
|
||||
* @author Mark Paluch
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.com/manual/reference/operator/aggregation/ifNull/">https://docs.mongodb.com/manual/reference/operator/aggregation/ifNull/</a>
|
||||
*/
|
||||
public static class IfNull implements AggregationExpression {
|
||||
|
||||
@@ -251,9 +251,8 @@ public class ConditionalOperators {
|
||||
/**
|
||||
* Creates new {@link IfNull}.
|
||||
*
|
||||
* @param fieldReference the field to check for a {@literal null} value, field reference must not be {@literal null}
|
||||
* .
|
||||
* @return
|
||||
* @param fieldReference the field to check for a {@literal null} value, field reference must not be {@literal null}.
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public static ThenBuilder ifNull(String fieldReference) {
|
||||
|
||||
@@ -265,8 +264,8 @@ public class ConditionalOperators {
|
||||
* Creates new {@link IfNull}.
|
||||
*
|
||||
* @param expression the expression to check for a {@literal null} value, field reference must not be
|
||||
* {@literal null}.
|
||||
* @return
|
||||
* {@literal null}.
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public static ThenBuilder ifNull(AggregationExpression expression) {
|
||||
|
||||
@@ -316,14 +315,14 @@ public class ConditionalOperators {
|
||||
|
||||
/**
|
||||
* @param fieldReference the field to check for a {@literal null} value, field reference must not be
|
||||
* {@literal null}.
|
||||
* {@literal null}.
|
||||
* @return the {@link ThenBuilder}
|
||||
*/
|
||||
ThenBuilder ifNull(String fieldReference);
|
||||
|
||||
/**
|
||||
* @param expression the expression to check for a {@literal null} value, field name must not be {@literal null}
|
||||
* or empty.
|
||||
* or empty.
|
||||
* @return the {@link ThenBuilder}
|
||||
*/
|
||||
ThenBuilder ifNull(AggregationExpression expression);
|
||||
@@ -336,21 +335,21 @@ public class ConditionalOperators {
|
||||
|
||||
/**
|
||||
* @param value the value to be used if the {@code $ifNull} condition evaluates {@literal true}. Can be a
|
||||
* {@link Document}, a value that is supported by MongoDB or a value that can be converted to a MongoDB
|
||||
* representation but must not be {@literal null}.
|
||||
* @return
|
||||
* {@link Document}, a value that is supported by MongoDB or a value that can be converted to a MongoDB
|
||||
* representation but must not be {@literal null}.
|
||||
* @return new instance of {@link IfNull}.
|
||||
*/
|
||||
IfNull then(Object value);
|
||||
|
||||
/**
|
||||
* @param fieldReference the field holding the replacement value, must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IfNull}.
|
||||
*/
|
||||
IfNull thenValueOf(String fieldReference);
|
||||
|
||||
/**
|
||||
* @param expression the expression yielding to the replacement value, must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IfNull}.
|
||||
*/
|
||||
IfNull thenValueOf(AggregationExpression expression);
|
||||
}
|
||||
@@ -364,7 +363,8 @@ public class ConditionalOperators {
|
||||
|
||||
private @Nullable Object condition;
|
||||
|
||||
private IfNullOperatorBuilder() {}
|
||||
private IfNullOperatorBuilder() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for {@link IfNull}.
|
||||
@@ -458,9 +458,15 @@ public class ConditionalOperators {
|
||||
public static Switch switchCases(List<CaseOperator> conditions) {
|
||||
|
||||
Assert.notNull(conditions, "Conditions must not be null!");
|
||||
return new Switch(Collections.<String, Object> singletonMap("branches", new ArrayList<CaseOperator>(conditions)));
|
||||
return new Switch(Collections.<String, Object>singletonMap("branches", new ArrayList<CaseOperator>(conditions)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Switch}.
|
||||
*/
|
||||
public Switch defaultTo(Object value) {
|
||||
return new Switch(append("default", value));
|
||||
}
|
||||
@@ -522,7 +528,7 @@ public class ConditionalOperators {
|
||||
* Set the then {@literal value}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link CaseOperator}.
|
||||
*/
|
||||
CaseOperator then(Object value);
|
||||
}
|
||||
@@ -536,10 +542,10 @@ public class ConditionalOperators {
|
||||
* {@link AggregationExpression expressions}, values of simple MongoDB types or values that can be converted to a
|
||||
* simple MongoDB type.
|
||||
*
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.com/manual/reference/operator/aggregation/cond/">https://docs.mongodb.com/manual/reference/operator/aggregation/cond/</a>
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.com/manual/reference/operator/aggregation/cond/">https://docs.mongodb.com/manual/reference/operator/aggregation/cond/</a>
|
||||
*/
|
||||
public static class Cond implements AggregationExpression {
|
||||
|
||||
@@ -664,7 +670,6 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
clauses.add(new Document(key, args));
|
||||
|
||||
} else if (predicate instanceof Document) {
|
||||
|
||||
Document nested = (Document) predicate;
|
||||
@@ -680,7 +685,6 @@ public class ConditionalOperators {
|
||||
args.add(nested.get(s));
|
||||
clauses.add(new Document(s, args));
|
||||
}
|
||||
|
||||
} else if (!isKeyword(key)) {
|
||||
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
@@ -802,8 +806,8 @@ public class ConditionalOperators {
|
||||
|
||||
/**
|
||||
* @param value the value to be used if the condition evaluates {@literal true}. Can be a {@link Document}, a
|
||||
* value that is supported by MongoDB or a value that can be converted to a MongoDB representation but
|
||||
* must not be {@literal null}.
|
||||
* value that is supported by MongoDB or a value that can be converted to a MongoDB representation but
|
||||
* must not be {@literal null}.
|
||||
* @return the {@link OtherwiseBuilder}
|
||||
*/
|
||||
OtherwiseBuilder then(Object value);
|
||||
@@ -828,8 +832,8 @@ public class ConditionalOperators {
|
||||
|
||||
/**
|
||||
* @param value the value to be used if the condition evaluates {@literal false}. Can be a {@link Document}, a
|
||||
* value that is supported by MongoDB or a value that can be converted to a MongoDB representation but
|
||||
* must not be {@literal null}.
|
||||
* value that is supported by MongoDB or a value that can be converted to a MongoDB representation but
|
||||
* must not be {@literal null}.
|
||||
* @return the {@link Cond}
|
||||
*/
|
||||
Cond otherwise(Object value);
|
||||
@@ -857,7 +861,8 @@ public class ConditionalOperators {
|
||||
private @Nullable Object condition;
|
||||
private @Nullable Object thenValue;
|
||||
|
||||
private ConditionalExpressionBuilder() {}
|
||||
private ConditionalExpressionBuilder() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for {@link Cond}.
|
||||
|
||||
@@ -34,9 +34,9 @@ public class CountOperation implements FieldsExposingAggregationOperation {
|
||||
private final String fieldName;
|
||||
|
||||
/**
|
||||
* Creates a new {@link CountOperation} given the {@link fieldName} field name.
|
||||
* Creates a new {@link CountOperation} given the {@literal fieldName} field name.
|
||||
*
|
||||
* @param asFieldName must not be {@literal null} or empty.
|
||||
* @param fieldName must not be {@literal null} or empty.
|
||||
*/
|
||||
public CountOperation(String fieldName) {
|
||||
|
||||
@@ -71,7 +71,7 @@ public class CountOperation implements FieldsExposingAggregationOperation {
|
||||
* Returns the finally to be applied {@link CountOperation} with the given alias.
|
||||
*
|
||||
* @param fieldName must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link CountOperation}.
|
||||
*/
|
||||
public CountOperation as(String fieldName) {
|
||||
return new CountOperation(fieldName);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class DataTypeOperators {
|
||||
* Return the BSON data type of the given {@literal field}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Type}.
|
||||
*/
|
||||
public static Type typeOf(String fieldReference) {
|
||||
return Type.typeOf(fieldReference);
|
||||
@@ -56,7 +56,7 @@ public class DataTypeOperators {
|
||||
* Creates new {@link Type}.
|
||||
*
|
||||
* @param field must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Type}.
|
||||
*/
|
||||
public static Type typeOf(String field) {
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class DateOperators {
|
||||
* Take the date referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DateOperatorFactory}.
|
||||
*/
|
||||
public static DateOperatorFactory dateOf(String fieldReference) {
|
||||
|
||||
@@ -49,7 +49,7 @@ public class DateOperators {
|
||||
* Take the date resulting from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DateOperatorFactory}.
|
||||
*/
|
||||
public static DateOperatorFactory dateOf(AggregationExpression expression) {
|
||||
|
||||
@@ -278,7 +278,7 @@ public class DateOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the day of the year for a date as a number between 1 and
|
||||
* 366.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link DayOfYear}.
|
||||
*/
|
||||
public DayOfYear dayOfYear() {
|
||||
return applyTimezone(DayOfYear.dayOfYear(dateReference()), timezone);
|
||||
@@ -288,7 +288,7 @@ public class DateOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the day of the month for a date as a number between 1 and
|
||||
* 31.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link DayOfMonth}.
|
||||
*/
|
||||
public DayOfMonth dayOfMonth() {
|
||||
return applyTimezone(DayOfMonth.dayOfMonth(dateReference()), timezone);
|
||||
@@ -298,7 +298,7 @@ public class DateOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the day of the week for a date as a number between 1
|
||||
* (Sunday) and 7 (Saturday).
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link DayOfWeek}.
|
||||
*/
|
||||
public DayOfWeek dayOfWeek() {
|
||||
return applyTimezone(DayOfWeek.dayOfWeek(dateReference()), timezone);
|
||||
@@ -307,7 +307,7 @@ public class DateOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns the year portion of a date.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Year}.
|
||||
*/
|
||||
public Year year() {
|
||||
return applyTimezone(Year.year(dateReference()), timezone);
|
||||
@@ -316,7 +316,7 @@ public class DateOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns the month of a date as a number between 1 and 12.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Month}.
|
||||
*/
|
||||
public Month month() {
|
||||
return applyTimezone(Month.month(dateReference()), timezone);
|
||||
@@ -326,7 +326,7 @@ public class DateOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the week of the year for a date as a number between 0 and
|
||||
* 53.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Week}.
|
||||
*/
|
||||
public Week week() {
|
||||
return applyTimezone(Week.week(dateReference()), timezone);
|
||||
@@ -335,7 +335,7 @@ public class DateOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns the hour portion of a date as a number between 0 and 23.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Hour}.
|
||||
*/
|
||||
public Hour hour() {
|
||||
return applyTimezone(Hour.hour(dateReference()), timezone);
|
||||
@@ -344,7 +344,7 @@ public class DateOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns the minute portion of a date as a number between 0 and 59.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Minute}.
|
||||
*/
|
||||
public Minute minute() {
|
||||
return applyTimezone(Minute.minute(dateReference()), timezone);
|
||||
@@ -354,7 +354,7 @@ public class DateOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the second portion of a date as a number between 0 and 59,
|
||||
* but can be 60 to account for leap seconds.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Second}.
|
||||
*/
|
||||
public Second second() {
|
||||
return applyTimezone(Second.second(dateReference()), timezone);
|
||||
@@ -364,7 +364,7 @@ public class DateOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the millisecond portion of a date as an integer between 0
|
||||
* and 999.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Millisecond}.
|
||||
*/
|
||||
public Millisecond millisecond() {
|
||||
return applyTimezone(Millisecond.millisecond(dateReference()), timezone);
|
||||
@@ -375,7 +375,7 @@ public class DateOperators {
|
||||
* {@literal format}.
|
||||
*
|
||||
* @param format must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DateToString}.
|
||||
*/
|
||||
public DateToString toString(String format) {
|
||||
return applyTimezone(DateToString.dateToString(dateReference()).toString(format), timezone);
|
||||
@@ -396,7 +396,7 @@ public class DateOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the weekday number in ISO 8601-2018 format, ranging from 1
|
||||
* (for Monday) to 7 (for Sunday).
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link IsoDayOfWeek}.
|
||||
*/
|
||||
public IsoDayOfWeek isoDayOfWeek() {
|
||||
return applyTimezone(IsoDayOfWeek.isoDayWeek(dateReference()), timezone);
|
||||
@@ -406,7 +406,7 @@ public class DateOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the week number in ISO 8601-2018 format, ranging from 1 to
|
||||
* 53.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link IsoWeek}.
|
||||
*/
|
||||
public IsoWeek isoWeek() {
|
||||
return applyTimezone(IsoWeek.isoWeek(dateReference()), timezone);
|
||||
@@ -415,7 +415,7 @@ public class DateOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that returns the year number in ISO 8601-2018 format.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link IsoWeekYear}.
|
||||
*/
|
||||
public IsoWeekYear isoWeekYear() {
|
||||
return applyTimezone(IsoWeekYear.isoWeekYear(dateReference()), timezone);
|
||||
@@ -642,7 +642,7 @@ public class DateOperators {
|
||||
* Creates new {@link DayOfYear}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DayOfYear}.
|
||||
*/
|
||||
public static DayOfYear dayOfYear(String fieldReference) {
|
||||
|
||||
@@ -654,7 +654,7 @@ public class DateOperators {
|
||||
* Creates new {@link DayOfYear}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DayOfYear}.
|
||||
*/
|
||||
public static DayOfYear dayOfYear(AggregationExpression expression) {
|
||||
|
||||
@@ -714,7 +714,7 @@ public class DateOperators {
|
||||
* Creates new {@link DayOfMonth}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DayOfMonth}.
|
||||
*/
|
||||
public static DayOfMonth dayOfMonth(String fieldReference) {
|
||||
|
||||
@@ -726,7 +726,7 @@ public class DateOperators {
|
||||
* Creates new {@link DayOfMonth}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DayOfMonth}.
|
||||
*/
|
||||
public static DayOfMonth dayOfMonth(AggregationExpression expression) {
|
||||
|
||||
@@ -786,7 +786,7 @@ public class DateOperators {
|
||||
* Creates new {@link DayOfWeek}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DayOfWeek}.
|
||||
*/
|
||||
public static DayOfWeek dayOfWeek(String fieldReference) {
|
||||
|
||||
@@ -798,7 +798,7 @@ public class DateOperators {
|
||||
* Creates new {@link DayOfWeek}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DayOfWeek}.
|
||||
*/
|
||||
public static DayOfWeek dayOfWeek(AggregationExpression expression) {
|
||||
|
||||
@@ -858,7 +858,7 @@ public class DateOperators {
|
||||
* Creates new {@link Year}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Year}.
|
||||
*/
|
||||
public static Year yearOf(String fieldReference) {
|
||||
|
||||
@@ -870,7 +870,7 @@ public class DateOperators {
|
||||
* Creates new {@link Year}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Year}.
|
||||
*/
|
||||
public static Year yearOf(AggregationExpression expression) {
|
||||
|
||||
@@ -930,7 +930,7 @@ public class DateOperators {
|
||||
* Creates new {@link Month}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Month}.
|
||||
*/
|
||||
public static Month monthOf(String fieldReference) {
|
||||
|
||||
@@ -942,7 +942,7 @@ public class DateOperators {
|
||||
* Creates new {@link Month}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Month}.
|
||||
*/
|
||||
public static Month monthOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1002,7 +1002,7 @@ public class DateOperators {
|
||||
* Creates new {@link Week}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Week}.
|
||||
*/
|
||||
public static Week weekOf(String fieldReference) {
|
||||
|
||||
@@ -1014,7 +1014,7 @@ public class DateOperators {
|
||||
* Creates new {@link Week}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Week}.
|
||||
*/
|
||||
public static Week weekOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1074,7 +1074,7 @@ public class DateOperators {
|
||||
* Creates new {@link Hour}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Hour}.
|
||||
*/
|
||||
public static Hour hourOf(String fieldReference) {
|
||||
|
||||
@@ -1086,7 +1086,7 @@ public class DateOperators {
|
||||
* Creates new {@link Hour}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Hour}.
|
||||
*/
|
||||
public static Hour hourOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1146,7 +1146,7 @@ public class DateOperators {
|
||||
* Creates new {@link Minute}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Minute}.
|
||||
*/
|
||||
public static Minute minuteOf(String fieldReference) {
|
||||
|
||||
@@ -1158,7 +1158,7 @@ public class DateOperators {
|
||||
* Creates new {@link Minute}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Minute}.
|
||||
*/
|
||||
public static Minute minuteOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1218,7 +1218,7 @@ public class DateOperators {
|
||||
* Creates new {@link Second}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Second}.
|
||||
*/
|
||||
public static Second secondOf(String fieldReference) {
|
||||
|
||||
@@ -1230,7 +1230,7 @@ public class DateOperators {
|
||||
* Creates new {@link Second}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Second}.
|
||||
*/
|
||||
public static Second secondOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1290,7 +1290,7 @@ public class DateOperators {
|
||||
* Creates new {@link Millisecond}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Millisecond}.
|
||||
*/
|
||||
public static Millisecond millisecondOf(String fieldReference) {
|
||||
|
||||
@@ -1302,7 +1302,7 @@ public class DateOperators {
|
||||
* Creates new {@link Millisecond}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Millisecond}.
|
||||
*/
|
||||
public static Millisecond millisecondOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1376,7 +1376,7 @@ public class DateOperators {
|
||||
* Creates new {@link FormatBuilder} allowing to define the date format to apply.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link FormatBuilder} to crate {@link DateToString}.
|
||||
*/
|
||||
public static FormatBuilder dateOf(final String fieldReference) {
|
||||
|
||||
@@ -1388,7 +1388,7 @@ public class DateOperators {
|
||||
* Creates new {@link FormatBuilder} allowing to define the date format to apply.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link FormatBuilder} to crate {@link DateToString}.
|
||||
*/
|
||||
public static FormatBuilder dateOf(final AggregationExpression expression) {
|
||||
|
||||
@@ -1540,7 +1540,7 @@ public class DateOperators {
|
||||
* Creates new {@link IsoDayOfWeek}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IsoDayOfWeek}.
|
||||
*/
|
||||
public static IsoDayOfWeek isoDayOfWeek(String fieldReference) {
|
||||
|
||||
@@ -1552,7 +1552,7 @@ public class DateOperators {
|
||||
* Creates new {@link IsoDayOfWeek}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IsoDayOfWeek}.
|
||||
*/
|
||||
public static IsoDayOfWeek isoDayOfWeek(AggregationExpression expression) {
|
||||
|
||||
@@ -1612,7 +1612,7 @@ public class DateOperators {
|
||||
* Creates new {@link IsoWeek}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IsoWeek}.
|
||||
*/
|
||||
public static IsoWeek isoWeekOf(String fieldReference) {
|
||||
|
||||
@@ -1624,7 +1624,7 @@ public class DateOperators {
|
||||
* Creates new {@link IsoWeek}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IsoWeek}.
|
||||
*/
|
||||
public static IsoWeek isoWeekOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1684,7 +1684,7 @@ public class DateOperators {
|
||||
* Creates new {@link IsoWeekYear}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IsoWeekYear}.
|
||||
*/
|
||||
public static IsoWeekYear isoWeekYearOf(String fieldReference) {
|
||||
|
||||
@@ -1696,7 +1696,7 @@ public class DateOperators {
|
||||
* Creates new {@link Millisecond}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IsoWeekYear}.
|
||||
*/
|
||||
public static IsoWeekYear isoWeekYearOf(AggregationExpression expression) {
|
||||
|
||||
@@ -2378,6 +2378,7 @@ public class DateOperators {
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T extends TimezonedDateAggregationExpression> T applyTimezone(T instance, Timezone timezone) {
|
||||
return !ObjectUtils.nullSafeEquals(Timezone.none(), timezone) && !instance.hasTimezone()
|
||||
? (T) instance.withTimezone(timezone) : instance;
|
||||
? (T) instance.withTimezone(timezone)
|
||||
: instance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
|
||||
/**
|
||||
* Returns an empty {@link ExposedFields} instance.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @since 2.0
|
||||
*/
|
||||
public static ExposedFields empty() {
|
||||
@@ -57,7 +57,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
|
||||
* Creates a new {@link ExposedFields} instance from the given {@link ExposedField}s.
|
||||
*
|
||||
* @param fields must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public static ExposedFields from(ExposedField... fields) {
|
||||
return from(Arrays.asList(fields));
|
||||
@@ -67,7 +67,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
|
||||
* Creates a new {@link ExposedFields} instance from the given {@link ExposedField}s.
|
||||
*
|
||||
* @param fields must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
private static ExposedFields from(List<ExposedField> fields) {
|
||||
|
||||
@@ -84,7 +84,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
|
||||
* Creates synthetic {@link ExposedFields} from the given {@link Fields}.
|
||||
*
|
||||
* @param fields must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public static ExposedFields synthetic(Fields fields) {
|
||||
return createFields(fields, true);
|
||||
@@ -94,7 +94,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
|
||||
* Creates non-synthetic {@link ExposedFields} from the given {@link Fields}.
|
||||
*
|
||||
* @param fields must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public static ExposedFields nonSynthetic(Fields fields) {
|
||||
return createFields(fields, false);
|
||||
@@ -105,7 +105,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
|
||||
*
|
||||
* @param fields must not be {@literal null}.
|
||||
* @param synthetic
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
private static ExposedFields createFields(Fields fields, boolean synthetic) {
|
||||
|
||||
@@ -135,7 +135,7 @@ public final class ExposedFields implements Iterable<ExposedField> {
|
||||
* Creates a new {@link ExposedFields} adding the given {@link ExposedField}.
|
||||
*
|
||||
* @param field must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ExposedFields}.
|
||||
*/
|
||||
public ExposedFields and(ExposedField field) {
|
||||
|
||||
@@ -151,8 +151,8 @@ public final class ExposedFields implements Iterable<ExposedField> {
|
||||
/**
|
||||
* Returns the field with the given name or {@literal null} if no field with the given name is available.
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
* @param name must not be {@literal null}.
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
public ExposedField getField(String name) {
|
||||
|
||||
@@ -146,7 +146,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
|
||||
* Set the {@literal collectionName} to apply the {@code $graphLookup} to.
|
||||
*
|
||||
* @param collectionName must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
StartWithBuilder from(String collectionName);
|
||||
}
|
||||
@@ -161,7 +161,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
|
||||
* Set the startWith {@literal fieldReferences} to apply the {@code $graphLookup} to.
|
||||
*
|
||||
* @param fieldReferences must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
ConnectFromBuilder startWith(String... fieldReferences);
|
||||
|
||||
@@ -169,7 +169,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
|
||||
* Set the startWith {@literal expressions} to apply the {@code $graphLookup} to.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
ConnectFromBuilder startWith(AggregationExpression... expressions);
|
||||
|
||||
@@ -178,7 +178,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
|
||||
* {@link AggregationExpression} to apply the {@code $graphLookup} to.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
ConnectFromBuilder startWith(Object... expressions);
|
||||
@@ -193,7 +193,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
|
||||
* Set the connectFrom {@literal fieldName} to apply the {@code $graphLookup} to.
|
||||
*
|
||||
* @param fieldName must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
ConnectToBuilder connectFrom(String fieldName);
|
||||
}
|
||||
@@ -207,7 +207,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
|
||||
* Set the connectTo {@literal fieldName} to apply the {@code $graphLookup} to.
|
||||
*
|
||||
* @param fieldName must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
GraphLookupOperationBuilder connectTo(String fieldName);
|
||||
}
|
||||
@@ -360,7 +360,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
|
||||
* Optionally limit the number of recursions.
|
||||
*
|
||||
* @param numberOfRecursions must be greater or equal to zero.
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public GraphLookupOperationBuilder maxDepth(long numberOfRecursions) {
|
||||
|
||||
@@ -374,7 +374,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
|
||||
* Optionally add a depth field {@literal fieldName} to each traversed document in the search path.
|
||||
*
|
||||
* @param fieldName must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public GraphLookupOperationBuilder depthField(String fieldName) {
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
|
||||
/**
|
||||
* Get a builder that allows creation of {@link LookupOperation}.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public static FromBuilder newLookup() {
|
||||
return new LookupOperationBuilder();
|
||||
@@ -99,7 +99,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
|
||||
|
||||
/**
|
||||
* @param name the collection in the same database to perform the join with, must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
LocalFieldBuilder from(String name);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
|
||||
/**
|
||||
* @param name the field from the documents input to the {@code $lookup} stage, must not be {@literal null} or
|
||||
* empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
ForeignFieldBuilder localField(String name);
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
|
||||
|
||||
/**
|
||||
* @param name the field from the documents in the {@code from} collection, must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
AsBuilder foreignField(String name);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
|
||||
|
||||
/**
|
||||
* @param name the name of the new array field to add to the input documents, must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link LookupOperation}.
|
||||
*/
|
||||
LookupOperation as(String name);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher
|
||||
/**
|
||||
* Merge Documents by using the MongoDB {@literal _id} field.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public static UniqueMergeId id() {
|
||||
return ID;
|
||||
@@ -375,7 +375,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher
|
||||
/**
|
||||
* Factory method creating {@link WhenDocumentsDontMatch} from a {@code value} literal.
|
||||
*
|
||||
* @param value
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link WhenDocumentsDontMatch}.
|
||||
*/
|
||||
public static WhenDocumentsDontMatch whenNotMatchedOf(String value) {
|
||||
@@ -403,7 +403,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher
|
||||
/**
|
||||
* Stop and fail the aggregation operation. Does not revert already performed changes on previous documents.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link WhenDocumentsDontMatch}.
|
||||
*/
|
||||
public static WhenDocumentsDontMatch failWhenNotMatch() {
|
||||
return whenNotMatchedOf("fail");
|
||||
|
||||
@@ -346,7 +346,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
|
||||
/**
|
||||
* Creates a {@link ReplacementDocument} given {@link ReplacementContributor}.
|
||||
*
|
||||
* @param contributor
|
||||
* @param contributor must not be {@literal null}.
|
||||
*/
|
||||
protected ReplacementDocument(ReplacementContributor contributor) {
|
||||
|
||||
@@ -362,7 +362,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
|
||||
* Creates a {@link ReplacementDocument} given a {@literal value}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ReplacementDocument}.
|
||||
*/
|
||||
public static ReplacementDocument valueOf(Object value) {
|
||||
return new ReplacementDocument(new DocumentContributor(value));
|
||||
@@ -372,7 +372,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
|
||||
* Creates a {@link ReplacementDocument} given a single {@literal field} and {@link AggregationExpression}.
|
||||
*
|
||||
* @param aggregationExpression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ReplacementDocument}.
|
||||
*/
|
||||
public static ReplacementDocument forExpression(String field, AggregationExpression aggregationExpression) {
|
||||
return new ReplacementDocument(new ExpressionFieldContributor(Fields.field(field), aggregationExpression));
|
||||
@@ -382,7 +382,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
|
||||
* Creates a {@link ReplacementDocument} given a single {@literal field} and {@literal value}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ReplacementDocument}.
|
||||
*/
|
||||
public static ReplacementDocument forSingleValue(String field, Object value) {
|
||||
return new ReplacementDocument(new ValueFieldContributor(Fields.field(field), value));
|
||||
@@ -438,7 +438,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
|
||||
* {@link AggregationOperationContext}.
|
||||
*
|
||||
* @param context will never be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
Document toDocument(AggregationOperationContext context);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ReplaceWithOperation extends ReplaceRootOperation {
|
||||
* {@link Field field reference}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link ReplaceWithOperation}.
|
||||
*/
|
||||
public static ReplaceWithOperation replaceWithValueOf(Object value) {
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SetOperators {
|
||||
* Take the array referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetOperatorFactory}.
|
||||
*/
|
||||
public static SetOperatorFactory arrayAsSet(String fieldReference) {
|
||||
return new SetOperatorFactory(fieldReference);
|
||||
@@ -44,7 +44,7 @@ public class SetOperators {
|
||||
* Take the array resulting from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetOperatorFactory}.
|
||||
*/
|
||||
public static SetOperatorFactory arrayAsSet(AggregationExpression expression) {
|
||||
return new SetOperatorFactory(expression);
|
||||
@@ -87,7 +87,7 @@ public class SetOperators {
|
||||
* returns {@literal true} if they have the same distinct elements and {@literal false} otherwise.
|
||||
*
|
||||
* @param arrayReferences must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetEquals}.
|
||||
*/
|
||||
public SetEquals isEqualTo(String... arrayReferences) {
|
||||
return createSetEquals().isEqualTo(arrayReferences);
|
||||
@@ -98,7 +98,7 @@ public class SetOperators {
|
||||
* returns {@literal true} if they have the same distinct elements and {@literal false} otherwise.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetEquals}.
|
||||
*/
|
||||
public SetEquals isEqualTo(AggregationExpression... expressions) {
|
||||
return createSetEquals().isEqualTo(expressions);
|
||||
@@ -113,7 +113,7 @@ public class SetOperators {
|
||||
* arrays and returns an array that contains the elements that appear in every of those.
|
||||
*
|
||||
* @param arrayReferences must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIntersection}.
|
||||
*/
|
||||
public SetIntersection intersects(String... arrayReferences) {
|
||||
return createSetIntersection().intersects(arrayReferences);
|
||||
@@ -124,7 +124,7 @@ public class SetOperators {
|
||||
* arrays and returns an array that contains the elements that appear in every of those.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIntersection}.
|
||||
*/
|
||||
public SetIntersection intersects(AggregationExpression... expressions) {
|
||||
return createSetIntersection().intersects(expressions);
|
||||
@@ -139,7 +139,7 @@ public class SetOperators {
|
||||
* arrays and returns an array that contains the elements that appear in any of those.
|
||||
*
|
||||
* @param arrayReferences must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetUnion}.
|
||||
*/
|
||||
public SetUnion union(String... arrayReferences) {
|
||||
return createSetUnion().union(arrayReferences);
|
||||
@@ -150,7 +150,7 @@ public class SetOperators {
|
||||
* arrays and returns an array that contains the elements that appear in any of those.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetUnion}.
|
||||
*/
|
||||
public SetUnion union(AggregationExpression... expressions) {
|
||||
return createSetUnion().union(expressions);
|
||||
@@ -165,7 +165,7 @@ public class SetOperators {
|
||||
* containing the elements that do not exist in the given {@literal arrayReference}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetDifference}.
|
||||
*/
|
||||
public SetDifference differenceTo(String arrayReference) {
|
||||
return createSetDifference().differenceTo(arrayReference);
|
||||
@@ -176,7 +176,7 @@ public class SetOperators {
|
||||
* containing the elements that do not exist in the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetDifference}.
|
||||
*/
|
||||
public SetDifference differenceTo(AggregationExpression expression) {
|
||||
return createSetDifference().differenceTo(expression);
|
||||
@@ -191,7 +191,7 @@ public class SetOperators {
|
||||
* {@literal true} if it is a subset of the given {@literal arrayReference}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIsSubset}.
|
||||
*/
|
||||
public SetIsSubset isSubsetOf(String arrayReference) {
|
||||
return createSetIsSubset().isSubsetOf(arrayReference);
|
||||
@@ -202,7 +202,7 @@ public class SetOperators {
|
||||
* {@literal true} if it is a subset of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIsSubset}.
|
||||
*/
|
||||
public SetIsSubset isSubsetOf(AggregationExpression expression) {
|
||||
return createSetIsSubset().isSubsetOf(expression);
|
||||
@@ -216,7 +216,7 @@ public class SetOperators {
|
||||
* Creates new {@link AggregationExpression} that takes array of the previously mentioned field and returns
|
||||
* {@literal true} if any of the elements are {@literal true} and {@literal false} otherwise.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link AnyElementTrue}.
|
||||
*/
|
||||
public AnyElementTrue anyElementTrue() {
|
||||
return usesFieldRef() ? AnyElementTrue.arrayAsSet(fieldReference) : AnyElementTrue.arrayAsSet(expression);
|
||||
@@ -226,7 +226,7 @@ public class SetOperators {
|
||||
* Creates new {@link AggregationExpression} that tkes array of the previously mentioned field and returns
|
||||
* {@literal true} if no elements is {@literal false}.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link AllElementsTrue}.
|
||||
*/
|
||||
public AllElementsTrue allElementsTrue() {
|
||||
return usesFieldRef() ? AllElementsTrue.arrayAsSet(fieldReference) : AllElementsTrue.arrayAsSet(expression);
|
||||
@@ -257,7 +257,7 @@ public class SetOperators {
|
||||
* Create new {@link SetEquals}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetEquals}.
|
||||
*/
|
||||
public static SetEquals arrayAsSet(String arrayReference) {
|
||||
|
||||
@@ -269,7 +269,7 @@ public class SetOperators {
|
||||
* Create new {@link SetEquals}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetEquals}.
|
||||
*/
|
||||
public static SetEquals arrayAsSet(AggregationExpression expression) {
|
||||
|
||||
@@ -281,7 +281,7 @@ public class SetOperators {
|
||||
* Creates new {@link java.util.Set} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param arrayReferences must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetEquals}.
|
||||
*/
|
||||
public SetEquals isEqualTo(String... arrayReferences) {
|
||||
|
||||
@@ -293,7 +293,7 @@ public class SetOperators {
|
||||
* Creates new {@link Sum} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetEquals}.
|
||||
*/
|
||||
public SetEquals isEqualTo(AggregationExpression... expressions) {
|
||||
|
||||
@@ -305,7 +305,7 @@ public class SetOperators {
|
||||
* Creates new {@link Sum} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param array must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetEquals}.
|
||||
*/
|
||||
public SetEquals isEqualTo(Object[] array) {
|
||||
|
||||
@@ -334,7 +334,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetIntersection}
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIntersection}.
|
||||
*/
|
||||
public static SetIntersection arrayAsSet(String arrayReference) {
|
||||
|
||||
@@ -346,7 +346,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetIntersection}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIntersection}.
|
||||
*/
|
||||
public static SetIntersection arrayAsSet(AggregationExpression expression) {
|
||||
|
||||
@@ -358,7 +358,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetIntersection} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param arrayReferences must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIntersection}.
|
||||
*/
|
||||
public SetIntersection intersects(String... arrayReferences) {
|
||||
|
||||
@@ -370,7 +370,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetIntersection} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIntersection}.
|
||||
*/
|
||||
public SetIntersection intersects(AggregationExpression... expressions) {
|
||||
|
||||
@@ -399,7 +399,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetUnion}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetUnion}.
|
||||
*/
|
||||
public static SetUnion arrayAsSet(String arrayReference) {
|
||||
|
||||
@@ -411,7 +411,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetUnion}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetUnion}.
|
||||
*/
|
||||
public static SetUnion arrayAsSet(AggregationExpression expression) {
|
||||
|
||||
@@ -423,7 +423,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetUnion} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param arrayReferences must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetUnion}.
|
||||
*/
|
||||
public SetUnion union(String... arrayReferences) {
|
||||
|
||||
@@ -435,7 +435,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetUnion} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetUnion}.
|
||||
*/
|
||||
public SetUnion union(AggregationExpression... expressions) {
|
||||
|
||||
@@ -464,7 +464,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetDifference}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetDifference}.
|
||||
*/
|
||||
public static SetDifference arrayAsSet(String arrayReference) {
|
||||
|
||||
@@ -476,7 +476,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetDifference}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetDifference}.
|
||||
*/
|
||||
public static SetDifference arrayAsSet(AggregationExpression expression) {
|
||||
|
||||
@@ -488,7 +488,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetDifference} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetDifference}.
|
||||
*/
|
||||
public SetDifference differenceTo(String arrayReference) {
|
||||
|
||||
@@ -500,7 +500,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetDifference} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetDifference}.
|
||||
*/
|
||||
public SetDifference differenceTo(AggregationExpression expression) {
|
||||
|
||||
@@ -529,7 +529,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetIsSubset}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIsSubset}.
|
||||
*/
|
||||
public static SetIsSubset arrayAsSet(String arrayReference) {
|
||||
|
||||
@@ -541,7 +541,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetIsSubset}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIsSubset}.
|
||||
*/
|
||||
public static SetIsSubset arrayAsSet(AggregationExpression expression) {
|
||||
|
||||
@@ -553,7 +553,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetIsSubset} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIsSubset}.
|
||||
*/
|
||||
public SetIsSubset isSubsetOf(String arrayReference) {
|
||||
|
||||
@@ -565,7 +565,7 @@ public class SetOperators {
|
||||
* Creates new {@link SetIsSubset} with all previously added arguments appending the given one.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SetIsSubset}.
|
||||
*/
|
||||
public SetIsSubset isSubsetOf(AggregationExpression expression) {
|
||||
|
||||
@@ -594,7 +594,7 @@ public class SetOperators {
|
||||
* Creates new {@link AnyElementTrue}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link AnyElementTrue}.
|
||||
*/
|
||||
public static AnyElementTrue arrayAsSet(String arrayReference) {
|
||||
|
||||
@@ -606,7 +606,7 @@ public class SetOperators {
|
||||
* Creates new {@link AnyElementTrue}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link AnyElementTrue}.
|
||||
*/
|
||||
public static AnyElementTrue arrayAsSet(AggregationExpression expression) {
|
||||
|
||||
@@ -639,7 +639,7 @@ public class SetOperators {
|
||||
* Creates new {@link AllElementsTrue}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link AllElementsTrue}.
|
||||
*/
|
||||
public static AllElementsTrue arrayAsSet(String arrayReference) {
|
||||
|
||||
@@ -651,7 +651,7 @@ public class SetOperators {
|
||||
* Creates new {@link AllElementsTrue}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link AllElementsTrue}.
|
||||
*/
|
||||
public static AllElementsTrue arrayAsSet(AggregationExpression expression) {
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class StringOperators {
|
||||
* Take the array referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StringOperatorFactory}.
|
||||
*/
|
||||
public static StringOperatorFactory valueOf(String fieldReference) {
|
||||
return new StringOperatorFactory(fieldReference);
|
||||
@@ -45,7 +45,7 @@ public class StringOperators {
|
||||
* Take the array referenced by given {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StringOperatorFactory}.
|
||||
*/
|
||||
public static StringOperatorFactory valueOf(AggregationExpression fieldReference) {
|
||||
return new StringOperatorFactory(fieldReference);
|
||||
@@ -88,7 +88,7 @@ public class StringOperators {
|
||||
* of the referenced field to it.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Concat}.
|
||||
*/
|
||||
public Concat concatValueOf(String fieldReference) {
|
||||
|
||||
@@ -101,7 +101,7 @@ public class StringOperators {
|
||||
* of the given {@link AggregationExpression} to it.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Concat}.
|
||||
*/
|
||||
public Concat concatValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -114,7 +114,7 @@ public class StringOperators {
|
||||
* {@literal value} to it.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Concat}.
|
||||
*/
|
||||
public Concat concat(String value) {
|
||||
|
||||
@@ -130,8 +130,8 @@ public class StringOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and returns a substring
|
||||
* starting at a specified index position.
|
||||
*
|
||||
* @param start
|
||||
* @return
|
||||
* @param start start index number (including)
|
||||
* @return new instance of {@link Substr}.
|
||||
*/
|
||||
public Substr substring(int start) {
|
||||
return substring(start, -1);
|
||||
@@ -141,9 +141,9 @@ public class StringOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and returns a substring
|
||||
* starting at a specified index position including the specified number of characters.
|
||||
*
|
||||
* @param start
|
||||
* @param nrOfChars
|
||||
* @return
|
||||
* @param start start index number (including)
|
||||
* @param nrOfChars number of characters.
|
||||
* @return new instance of {@link Substr}.
|
||||
*/
|
||||
public Substr substring(int start, int nrOfChars) {
|
||||
return createSubstr().substring(start, nrOfChars);
|
||||
@@ -156,7 +156,7 @@ public class StringOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and lowers it.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link ToLower}.
|
||||
*/
|
||||
public ToLower toLower() {
|
||||
return usesFieldRef() ? ToLower.lowerValueOf(fieldReference) : ToLower.lowerValueOf(expression);
|
||||
@@ -165,7 +165,7 @@ public class StringOperators {
|
||||
/**
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and uppers it.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link ToUpper}.
|
||||
*/
|
||||
public ToUpper toUpper() {
|
||||
return usesFieldRef() ? ToUpper.upperValueOf(fieldReference) : ToUpper.upperValueOf(expression);
|
||||
@@ -176,7 +176,7 @@ public class StringOperators {
|
||||
* case-insensitive comparison to the given {@literal value}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StrCaseCmp}.
|
||||
*/
|
||||
public StrCaseCmp strCaseCmp(String value) {
|
||||
|
||||
@@ -189,7 +189,7 @@ public class StringOperators {
|
||||
* case-insensitive comparison to the referenced {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StrCaseCmp}.
|
||||
*/
|
||||
public StrCaseCmp strCaseCmpValueOf(String fieldReference) {
|
||||
|
||||
@@ -202,7 +202,7 @@ public class StringOperators {
|
||||
* case-insensitive comparison to the result of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StrCaseCmp}.
|
||||
*/
|
||||
public StrCaseCmp strCaseCmpValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -220,7 +220,7 @@ public class StringOperators {
|
||||
* occurrence.
|
||||
*
|
||||
* @param substring must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfBytes}.
|
||||
*/
|
||||
public IndexOfBytes indexOf(String substring) {
|
||||
|
||||
@@ -234,7 +234,7 @@ public class StringOperators {
|
||||
* index (zero-based) of the first occurrence.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfBytes}.
|
||||
*/
|
||||
public IndexOfBytes indexOf(Field fieldReference) {
|
||||
|
||||
@@ -248,7 +248,7 @@ public class StringOperators {
|
||||
* byte index (zero-based) of the first occurrence.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfBytes}.
|
||||
*/
|
||||
public IndexOfBytes indexOf(AggregationExpression expression) {
|
||||
|
||||
@@ -266,7 +266,7 @@ public class StringOperators {
|
||||
* first occurrence.
|
||||
*
|
||||
* @param substring must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfCP}.
|
||||
*/
|
||||
public IndexOfCP indexOfCP(String substring) {
|
||||
|
||||
@@ -280,7 +280,7 @@ public class StringOperators {
|
||||
* point index (zero-based) of the first occurrence.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfCP}.
|
||||
*/
|
||||
public IndexOfCP indexOfCP(Field fieldReference) {
|
||||
|
||||
@@ -294,7 +294,7 @@ public class StringOperators {
|
||||
* code point index (zero-based) of the first occurrence.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfCP}.
|
||||
*/
|
||||
public IndexOfCP indexOfCP(AggregationExpression expression) {
|
||||
|
||||
@@ -311,7 +311,7 @@ public class StringOperators {
|
||||
* substrings based on the given delimiter.
|
||||
*
|
||||
* @param delimiter must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Split}.
|
||||
*/
|
||||
public Split split(String delimiter) {
|
||||
return createSplit().split(delimiter);
|
||||
@@ -322,7 +322,7 @@ public class StringOperators {
|
||||
* substrings based on the delimiter resulting from the referenced field..
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Split}.
|
||||
*/
|
||||
public Split split(Field fieldReference) {
|
||||
return createSplit().split(fieldReference);
|
||||
@@ -333,7 +333,7 @@ public class StringOperators {
|
||||
* substrings based on a delimiter resulting from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Split}.
|
||||
*/
|
||||
public Split split(AggregationExpression expression) {
|
||||
return createSplit().split(expression);
|
||||
@@ -347,7 +347,7 @@ public class StringOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the number of UTF-8 bytes in the associated string
|
||||
* representation.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link StrLenBytes}.
|
||||
*/
|
||||
public StrLenBytes length() {
|
||||
return usesFieldRef() ? StrLenBytes.stringLengthOf(fieldReference) : StrLenBytes.stringLengthOf(expression);
|
||||
@@ -357,7 +357,7 @@ public class StringOperators {
|
||||
* Creates new {@link AggregationExpression} that returns the number of UTF-8 code points in the associated string
|
||||
* representation.
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link StrLenCP}.
|
||||
*/
|
||||
public StrLenCP lengthCP() {
|
||||
return usesFieldRef() ? StrLenCP.stringLengthOfCP(fieldReference) : StrLenCP.stringLengthOfCP(expression);
|
||||
@@ -368,7 +368,7 @@ public class StringOperators {
|
||||
* starting at a specified code point index position.
|
||||
*
|
||||
* @param codePointStart
|
||||
* @return
|
||||
* @return new instance of {@link SubstrCP}.
|
||||
*/
|
||||
public SubstrCP substringCP(int codePointStart) {
|
||||
return substringCP(codePointStart, -1);
|
||||
@@ -378,9 +378,9 @@ public class StringOperators {
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and returns a substring
|
||||
* starting at a specified code point index position including the specified number of code points.
|
||||
*
|
||||
* @param codePointStart
|
||||
* @param codePointStart start point (including).
|
||||
* @param nrOfCodePoints
|
||||
* @return
|
||||
* @return new instance of {@link SubstrCP}.
|
||||
*/
|
||||
public SubstrCP substringCP(int codePointStart, int nrOfCodePoints) {
|
||||
return createSubstrCP().substringCP(codePointStart, nrOfCodePoints);
|
||||
@@ -541,7 +541,7 @@ public class StringOperators {
|
||||
* Creates new {@link Concat}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Concat}.
|
||||
*/
|
||||
public static Concat valueOf(String fieldReference) {
|
||||
|
||||
@@ -553,7 +553,7 @@ public class StringOperators {
|
||||
* Creates new {@link Concat}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Concat}.
|
||||
*/
|
||||
public static Concat valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -565,7 +565,7 @@ public class StringOperators {
|
||||
* Creates new {@link Concat}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Concat}.
|
||||
*/
|
||||
public static Concat stringValue(String value) {
|
||||
|
||||
@@ -573,18 +573,36 @@ public class StringOperators {
|
||||
return new Concat(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Concat the value of the given field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return new instance of {@link Concat}.
|
||||
*/
|
||||
public Concat concatValueOf(String fieldReference) {
|
||||
|
||||
Assert.notNull(fieldReference, "FieldReference must not be null!");
|
||||
return new Concat(append(Fields.field(fieldReference)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Concat the value resulting from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return new instance of {@link Concat}.
|
||||
*/
|
||||
public Concat concatValueOf(AggregationExpression expression) {
|
||||
|
||||
Assert.notNull(expression, "Expression must not be null!");
|
||||
return new Concat(append(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Concat the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return new instance of {@link Concat}.
|
||||
*/
|
||||
public Concat concat(String value) {
|
||||
return new Concat(append(value));
|
||||
}
|
||||
@@ -610,7 +628,7 @@ public class StringOperators {
|
||||
* Creates new {@link Substr}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Substr}.
|
||||
*/
|
||||
public static Substr valueOf(String fieldReference) {
|
||||
|
||||
@@ -622,7 +640,7 @@ public class StringOperators {
|
||||
* Creates new {@link Substr}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Substr}.
|
||||
*/
|
||||
public static Substr valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -630,10 +648,19 @@ public class StringOperators {
|
||||
return new Substr(Collections.singletonList(expression));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param start start index (including)
|
||||
* @return new instance of {@link Substr}.
|
||||
*/
|
||||
public Substr substring(int start) {
|
||||
return substring(start, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param start start index (including)
|
||||
* @param nrOfChars
|
||||
* @return new instance of {@link Substr}.
|
||||
*/
|
||||
public Substr substring(int start, int nrOfChars) {
|
||||
return new Substr(append(Arrays.asList(start, nrOfChars)));
|
||||
}
|
||||
@@ -777,7 +804,7 @@ public class StringOperators {
|
||||
* Creates new {@link StrCaseCmp}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StrCaseCmp}.
|
||||
*/
|
||||
public static StrCaseCmp valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -789,7 +816,7 @@ public class StringOperators {
|
||||
* Creates new {@link StrCaseCmp}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StrCaseCmp}.
|
||||
*/
|
||||
public static StrCaseCmp stringValue(String value) {
|
||||
|
||||
@@ -834,7 +861,7 @@ public class StringOperators {
|
||||
* Start creating a new {@link IndexOfBytes}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SubstringBuilder}.
|
||||
*/
|
||||
public static SubstringBuilder valueOf(String fieldReference) {
|
||||
|
||||
@@ -846,7 +873,7 @@ public class StringOperators {
|
||||
* Start creating a new {@link IndexOfBytes}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SubstringBuilder}.
|
||||
*/
|
||||
public static SubstringBuilder valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -858,7 +885,7 @@ public class StringOperators {
|
||||
* Optionally define the substring search start and end position.
|
||||
*
|
||||
* @param range must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfBytes}.
|
||||
*/
|
||||
public IndexOfBytes within(Range<Long> range) {
|
||||
return new IndexOfBytes(append(AggregationUtils.toRangeValues(range)));
|
||||
@@ -876,7 +903,7 @@ public class StringOperators {
|
||||
* Creates a new {@link IndexOfBytes} given {@literal substring}.
|
||||
*
|
||||
* @param substring must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfBytes}.
|
||||
*/
|
||||
public IndexOfBytes indexOf(String substring) {
|
||||
return new IndexOfBytes(Arrays.asList(stringExpression, substring));
|
||||
@@ -886,7 +913,7 @@ public class StringOperators {
|
||||
* Creates a new {@link IndexOfBytes} given {@link AggregationExpression} that resolves to the substring.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfBytes}.
|
||||
*/
|
||||
public IndexOfBytes indexOf(AggregationExpression expression) {
|
||||
return new IndexOfBytes(Arrays.asList(stringExpression, expression));
|
||||
@@ -896,7 +923,7 @@ public class StringOperators {
|
||||
* Creates a new {@link IndexOfBytes} given {@link Field} that resolves to the substring.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfBytes}.
|
||||
*/
|
||||
public IndexOfBytes indexOf(Field fieldReference) {
|
||||
return new IndexOfBytes(Arrays.asList(stringExpression, fieldReference));
|
||||
@@ -924,7 +951,7 @@ public class StringOperators {
|
||||
* Start creating a new {@link IndexOfCP}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfCP}.
|
||||
*/
|
||||
public static SubstringBuilder valueOf(String fieldReference) {
|
||||
|
||||
@@ -936,7 +963,7 @@ public class StringOperators {
|
||||
* Start creating a new {@link IndexOfCP}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfCP}.
|
||||
*/
|
||||
public static SubstringBuilder valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -948,7 +975,7 @@ public class StringOperators {
|
||||
* Optionally define the substring search start and end position.
|
||||
*
|
||||
* @param range must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfCP}.
|
||||
*/
|
||||
public IndexOfCP within(Range<Long> range) {
|
||||
return new IndexOfCP(append(AggregationUtils.toRangeValues(range)));
|
||||
@@ -966,7 +993,7 @@ public class StringOperators {
|
||||
* Creates a new {@link IndexOfCP} given {@literal substring}.
|
||||
*
|
||||
* @param substring must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfCP}.
|
||||
*/
|
||||
public IndexOfCP indexOf(String substring) {
|
||||
return new IndexOfCP(Arrays.asList(stringExpression, substring));
|
||||
@@ -976,7 +1003,7 @@ public class StringOperators {
|
||||
* Creates a new {@link IndexOfCP} given {@link AggregationExpression} that resolves to the substring.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IndexOfCP}.
|
||||
*/
|
||||
public IndexOfCP indexOf(AggregationExpression expression) {
|
||||
return new IndexOfCP(Arrays.asList(stringExpression, expression));
|
||||
@@ -1014,7 +1041,7 @@ public class StringOperators {
|
||||
* Start creating a new {@link Split}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Split}.
|
||||
*/
|
||||
public static Split valueOf(String fieldReference) {
|
||||
|
||||
@@ -1026,7 +1053,7 @@ public class StringOperators {
|
||||
* Start creating a new {@link Split}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Split}.
|
||||
*/
|
||||
public static Split valueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1038,7 +1065,7 @@ public class StringOperators {
|
||||
* Use given {@link String} as delimiter.
|
||||
*
|
||||
* @param delimiter must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Split}.
|
||||
*/
|
||||
public Split split(String delimiter) {
|
||||
|
||||
@@ -1050,7 +1077,7 @@ public class StringOperators {
|
||||
* Use value of referenced field as delimiter.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Split}.
|
||||
*/
|
||||
public Split split(Field fieldReference) {
|
||||
|
||||
@@ -1062,7 +1089,7 @@ public class StringOperators {
|
||||
* Use value resulting from {@link AggregationExpression} as delimiter.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Split}.
|
||||
*/
|
||||
public Split split(AggregationExpression expression) {
|
||||
|
||||
@@ -1091,7 +1118,7 @@ public class StringOperators {
|
||||
* Creates new {@link StrLenBytes}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StrLenBytes}.
|
||||
*/
|
||||
public static StrLenBytes stringLengthOf(String fieldReference) {
|
||||
return new StrLenBytes(Fields.field(fieldReference));
|
||||
@@ -1101,7 +1128,7 @@ public class StringOperators {
|
||||
* Creates new {@link StrLenBytes}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StrLenBytes}.
|
||||
*/
|
||||
public static StrLenBytes stringLengthOf(AggregationExpression expression) {
|
||||
|
||||
@@ -1130,7 +1157,7 @@ public class StringOperators {
|
||||
* Creates new {@link StrLenCP}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StrLenCP}.
|
||||
*/
|
||||
public static StrLenCP stringLengthOfCP(String fieldReference) {
|
||||
return new StrLenCP(Fields.field(fieldReference));
|
||||
@@ -1140,7 +1167,7 @@ public class StringOperators {
|
||||
* Creates new {@link StrLenCP}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link StrLenCP}.
|
||||
*/
|
||||
public static StrLenCP stringLengthOfCP(AggregationExpression expression) {
|
||||
|
||||
@@ -1169,7 +1196,7 @@ public class StringOperators {
|
||||
* Creates new {@link SubstrCP}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SubstrCP}.
|
||||
*/
|
||||
public static SubstrCP valueOf(String fieldReference) {
|
||||
|
||||
@@ -1181,7 +1208,7 @@ public class StringOperators {
|
||||
* Creates new {@link SubstrCP}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link SubstrCP}.
|
||||
*/
|
||||
public static SubstrCP valueOf(AggregationExpression expression) {
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public abstract class AbstractMongoConverter implements MongoConverter, Initiali
|
||||
/**
|
||||
* Registers {@link EntityInstantiators} to customize entity instantiation.
|
||||
*
|
||||
* @param instantiators
|
||||
* @param instantiators can be {@literal null}. Uses default {@link EntityInstantiators} if so.
|
||||
*/
|
||||
public void setInstantiators(@Nullable EntityInstantiators instantiators) {
|
||||
this.instantiators = instantiators == null ? new EntityInstantiators() : instantiators;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CustomConversions extends MongoCustomConversions {
|
||||
/**
|
||||
* Creates a new {@link CustomConversions} instance registering the given converters.
|
||||
*
|
||||
* @param converters
|
||||
* @param converters must not be {@literal null}.
|
||||
*/
|
||||
public CustomConversions(List<?> converters) {
|
||||
super(converters);
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface DbRefResolver {
|
||||
* @param property will never be {@literal null}.
|
||||
* @param dbref the {@link DBRef} to resolve.
|
||||
* @param callback will never be {@literal null}.
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
Object resolveDbRef(MongoPersistentProperty property, @Nullable DBRef dbref, DbRefResolverCallback callback,
|
||||
@@ -58,7 +58,7 @@ public interface DbRefResolver {
|
||||
* @param annotation will never be {@literal null}.
|
||||
* @param entity will never be {@literal null}.
|
||||
* @param id will never be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link DBRef}.
|
||||
*/
|
||||
default DBRef createDbRef(@Nullable org.springframework.data.mongodb.core.mapping.DBRef annotation,
|
||||
MongoPersistentEntity<?> entity, Object id) {
|
||||
@@ -74,7 +74,7 @@ public interface DbRefResolver {
|
||||
* Actually loads the {@link DBRef} from the datasource.
|
||||
*
|
||||
* @param dbRef must not be {@literal null}.
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
* @since 1.7
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.function.UnaryOperator;
|
||||
|
||||
import org.bson.Document;
|
||||
import org.bson.conversions.Bson;
|
||||
|
||||
import org.springframework.data.convert.CustomConversions;
|
||||
import org.springframework.data.convert.DefaultTypeMapper;
|
||||
import org.springframework.data.convert.SimpleTypeInformationMapper;
|
||||
@@ -42,9 +41,7 @@ import com.mongodb.DBObject;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link MongoTypeMapper} allowing configuration of the key to lookup and store type
|
||||
* information in {@link Document}. The key defaults to {@link #DEFAULT_TYPE_KEY}. Actual type-to-{@link String}
|
||||
* conversion and back is done in {@link #getTypeString(TypeInformation)} or {@link #getTypeInformation(String)}
|
||||
* respectively.
|
||||
* information in {@link Document}. The key defaults to {@link #DEFAULT_TYPE_KEY}.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
@@ -111,7 +108,7 @@ public class DefaultMongoTypeMapper extends DefaultTypeMapper<Bson> implements M
|
||||
* {@link TypeInformationMapper} to map type hints.
|
||||
*
|
||||
* @param typeKey name of the field to read and write type hints. Can be {@literal null} to disable type hints.
|
||||
* @param mappers
|
||||
* @param mappers must not be {@literal null}.
|
||||
*/
|
||||
public DefaultMongoTypeMapper(@Nullable String typeKey, List<? extends TypeInformationMapper> mappers) {
|
||||
this(typeKey, new DocumentTypeAliasAccessor(typeKey), null, mappers);
|
||||
|
||||
@@ -70,10 +70,10 @@ class DocumentAccessor {
|
||||
/**
|
||||
* Puts the given value into the backing {@link Document} based on the coordinates defined through the given
|
||||
* {@link MongoPersistentProperty}. By default this will be the plain field name. But field names might also consist
|
||||
* of path traversals so we might need to create intermediate {@link BasicDocument}s.
|
||||
* of path traversals so we might need to create intermediate {@link Document}s.
|
||||
*
|
||||
* @param prop must not be {@literal null}.
|
||||
* @param value
|
||||
* @param value can be {@literal null}.
|
||||
*/
|
||||
public void put(MongoPersistentProperty prop, @Nullable Object value) {
|
||||
|
||||
@@ -106,7 +106,7 @@ class DocumentAccessor {
|
||||
* a path expression in the field name metadata.
|
||||
*
|
||||
* @param property must not be {@literal null}.
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
public Object get(MongoPersistentProperty property) {
|
||||
@@ -150,7 +150,7 @@ class DocumentAccessor {
|
||||
* {@link MongoPersistentProperty}.
|
||||
*
|
||||
* @param property must not be {@literal null}.
|
||||
* @return
|
||||
* @return {@literal true} if no non {@literal null} value present.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean hasValue(MongoPersistentProperty property) {
|
||||
@@ -203,7 +203,7 @@ class DocumentAccessor {
|
||||
* Returns the given source object as map, i.e. {@link Document}s and maps as is or {@literal null} otherwise.
|
||||
*
|
||||
* @param source can be {@literal null}.
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -91,7 +91,7 @@ abstract class GeoConverters {
|
||||
/**
|
||||
* Returns the geo converters to be registered.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Collection<? extends Object> getConvertersToRegister() {
|
||||
@@ -817,8 +817,8 @@ abstract class GeoConverters {
|
||||
/**
|
||||
* Converts a coordinate pairs nested in in {@link BasicDBList} into {@link GeoJsonPoint}s.
|
||||
*
|
||||
* @param listOfCoordinatePairs
|
||||
* @return
|
||||
* @param listOfCoordinatePairs must not be {@literal null}.
|
||||
* @return never {@literal null}.
|
||||
* @since 1.7
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -841,8 +841,8 @@ abstract class GeoConverters {
|
||||
/**
|
||||
* Converts a coordinate pairs nested in in {@link BasicDBList} into {@link GeoJsonPolygon}.
|
||||
*
|
||||
* @param dbList
|
||||
* @return
|
||||
* @param dbList must not be {@literal null}.
|
||||
* @return never {@literal null}.
|
||||
* @since 1.7
|
||||
*/
|
||||
static GeoJsonPolygon toGeoJsonPolygon(List dbList) {
|
||||
|
||||
@@ -497,7 +497,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
|
||||
* Root entry method into write conversion. Adds a type discriminator to the {@link Document}. Shouldn't be called for
|
||||
* nested conversions.
|
||||
*
|
||||
* @see org.springframework.data.mongodb.core.convert.MongoWriter#write(java.lang.Object, com.mongodb.Document)
|
||||
* @see org.springframework.data.mongodb.core.convert.MongoWriter#write(java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
public void write(Object obj, Bson bson) {
|
||||
|
||||
|
||||
@@ -119,8 +119,8 @@ public interface MongoConverter
|
||||
/**
|
||||
* Converts the given raw id value into either {@link ObjectId} or {@link String}.
|
||||
*
|
||||
* @param id
|
||||
* @param targetType
|
||||
* @param id can be {@literal null}.
|
||||
* @param targetType must not be {@literal null}.
|
||||
* @return {@literal null} if source {@literal id} is already {@literal null}.
|
||||
* @since 2.2
|
||||
*/
|
||||
|
||||
@@ -816,7 +816,7 @@ public class QueryMapper {
|
||||
protected final String name;
|
||||
|
||||
/**
|
||||
* Creates a new {@link DocumentField} without meta-information but the given name.
|
||||
* Creates a new {@link Field} without meta-information but the given name.
|
||||
*
|
||||
* @param name must not be {@literal null} or empty.
|
||||
*/
|
||||
@@ -827,7 +827,7 @@ public class QueryMapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new {@link DocumentField} with the given name.
|
||||
* Returns a new {@link Field} with the given name.
|
||||
*
|
||||
* @param name must not be {@literal null} or empty.
|
||||
* @return
|
||||
|
||||
@@ -37,7 +37,7 @@ interface ValueResolver {
|
||||
* @param prop
|
||||
* @param bson
|
||||
* @param evaluator
|
||||
* @param parent
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package org.springframework.data.mongodb.core.geo;
|
||||
|
||||
/**
|
||||
* Interface definition for structures defined in GeoJSON ({@link https://geojson.org/}) format.
|
||||
* Interface definition for structures defined in <a href="https://geojson.org/>GeoJSON</a> format.
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
* @since 1.7
|
||||
|
||||
@@ -38,7 +38,7 @@ public class GeoJsonGeometryCollection implements GeoJson<Iterable<GeoJson<?>>>
|
||||
/**
|
||||
* Creates a new {@link GeoJsonGeometryCollection} for the given {@link GeoJson} instances.
|
||||
*
|
||||
* @param geometries
|
||||
* @param geometries must not be {@literal null}.
|
||||
*/
|
||||
public GeoJsonGeometryCollection(List<GeoJson<?>> geometries) {
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class Sphere implements Shape {
|
||||
/**
|
||||
* Creates a Sphere around the given center {@link Point} with the given radius.
|
||||
*
|
||||
* @param center
|
||||
* @param center must not be {@literal null}.
|
||||
* @param radius
|
||||
*/
|
||||
public Sphere(Point center, double radius) {
|
||||
@@ -68,7 +68,7 @@ public class Sphere implements Shape {
|
||||
/**
|
||||
* Creates a Sphere from the given {@link Circle}.
|
||||
*
|
||||
* @param circle
|
||||
* @param circle must not be {@literal null}.
|
||||
*/
|
||||
public Sphere(Circle circle) {
|
||||
this(circle.getCenter(), circle.getRadius());
|
||||
@@ -86,7 +86,7 @@ public class Sphere implements Shape {
|
||||
/**
|
||||
* Returns the radius of the {@link Circle}.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Distance getRadius() {
|
||||
return radius;
|
||||
@@ -136,7 +136,7 @@ public class Sphere implements Shape {
|
||||
* Returns the {@link Shape} as a list of usually {@link Double} or {@link List}s of {@link Double}s. Wildcard bound
|
||||
* to allow implementations to return a more concrete element type.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public List<? extends Object> asList() {
|
||||
return Arrays.asList(Arrays.asList(center.getX(), center.getY()), this.radius.getValue());
|
||||
@@ -145,7 +145,7 @@ public class Sphere implements Shape {
|
||||
/**
|
||||
* Returns the command to be used to create the {@literal $within} criterion.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public String getCommand() {
|
||||
return COMMAND;
|
||||
|
||||
@@ -74,7 +74,7 @@ public @interface CompoundIndex {
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @return
|
||||
* @return empty String by default.
|
||||
*/
|
||||
String def() default "";
|
||||
|
||||
@@ -82,13 +82,13 @@ public @interface CompoundIndex {
|
||||
* It does not actually make sense to use that attribute as the direction has to be defined in the {@link #def()}
|
||||
* attribute actually.
|
||||
*
|
||||
* @return
|
||||
* @return {@link IndexDirection#ASCENDING} by default.
|
||||
*/
|
||||
@Deprecated
|
||||
IndexDirection direction() default IndexDirection.ASCENDING;
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/index-unique/">https://docs.mongodb.org/manual/core/index-unique/</a>
|
||||
*/
|
||||
@@ -97,14 +97,14 @@ public @interface CompoundIndex {
|
||||
/**
|
||||
* If set to true index will skip over any document that is missing the indexed field.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/index-sparse/">https://docs.mongodb.org/manual/core/index-sparse/</a>
|
||||
*/
|
||||
boolean sparse() default false;
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/index-creation/#index-creation-duplicate-dropping">https://docs.mongodb.org/manual/core/index-creation/#index-creation-duplicate-dropping</a>
|
||||
* @deprecated since 2.1. No longer supported by MongoDB as of server version 3.0.
|
||||
@@ -148,7 +148,7 @@ public @interface CompoundIndex {
|
||||
* db.hybrid.createIndex( { h1: 1, h2: 1 } , { name: "compound_index" } )
|
||||
* </pre>
|
||||
*
|
||||
* @return
|
||||
* @return empty String by default.
|
||||
*/
|
||||
String name() default "";
|
||||
|
||||
@@ -156,7 +156,7 @@ public @interface CompoundIndex {
|
||||
* If set to {@literal true} then MongoDB will ignore the given index name and instead generate a new name. Defaults
|
||||
* to {@literal false}.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal false} by default
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean useGeneratedName() default false;
|
||||
@@ -164,7 +164,7 @@ public @interface CompoundIndex {
|
||||
/**
|
||||
* If {@literal true} the index will be created in the background.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/indexes/#background-construction">https://docs.mongodb.org/manual/core/indexes/#background-construction</a>
|
||||
*/
|
||||
|
||||
@@ -72,7 +72,7 @@ public @interface GeoSpatialIndexed {
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
* @return
|
||||
* @return empty {@link String} by default.
|
||||
*/
|
||||
String name() default "";
|
||||
|
||||
@@ -80,7 +80,7 @@ public @interface GeoSpatialIndexed {
|
||||
* If set to {@literal true} then MongoDB will ignore the given index name and instead generate a new name. Defaults
|
||||
* to {@literal false}.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean useGeneratedName() default false;
|
||||
@@ -88,21 +88,21 @@ public @interface GeoSpatialIndexed {
|
||||
/**
|
||||
* Minimum value for indexed values.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal -180} by default.
|
||||
*/
|
||||
int min() default -180;
|
||||
|
||||
/**
|
||||
* Maximum value for indexed values.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal +180} by default.
|
||||
*/
|
||||
int max() default 180;
|
||||
|
||||
/**
|
||||
* Bits of precision for boundary calculations.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal 26} by default.
|
||||
*/
|
||||
int bits() default 26;
|
||||
|
||||
@@ -110,7 +110,7 @@ public @interface GeoSpatialIndexed {
|
||||
* The type of the geospatial index. Default is {@link GeoSpatialIndexType#GEO_2D}
|
||||
*
|
||||
* @since 1.4
|
||||
* @return
|
||||
* @return {@link GeoSpatialIndexType#GEO_2D} by default.
|
||||
*/
|
||||
GeoSpatialIndexType type() default GeoSpatialIndexType.GEO_2D;
|
||||
|
||||
@@ -118,7 +118,7 @@ public @interface GeoSpatialIndexed {
|
||||
* The bucket size for {@link GeoSpatialIndexType#GEO_HAYSTACK} indexes, in coordinate units.
|
||||
*
|
||||
* @since 1.4
|
||||
* @return
|
||||
* @return {@literal 1.0} by default.
|
||||
*/
|
||||
double bucketSize() default 1.0;
|
||||
|
||||
@@ -126,7 +126,7 @@ public @interface GeoSpatialIndexed {
|
||||
* The name of the additional field to use for {@link GeoSpatialIndexType#GEO_HAYSTACK} indexes
|
||||
*
|
||||
* @since 1.4
|
||||
* @return
|
||||
* @return empty {@link String} by default.
|
||||
*/
|
||||
String additionalField() default "";
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
|
||||
/**
|
||||
* @param name must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public GeospatialIndex named(String name) {
|
||||
|
||||
@@ -69,7 +69,7 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
|
||||
/**
|
||||
* @param min
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public GeospatialIndex withMin(int min) {
|
||||
this.min = Integer.valueOf(min);
|
||||
@@ -78,7 +78,7 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
|
||||
/**
|
||||
* @param max
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public GeospatialIndex withMax(int max) {
|
||||
this.max = Integer.valueOf(max);
|
||||
@@ -87,7 +87,7 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
|
||||
/**
|
||||
* @param bits
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public GeospatialIndex withBits(int bits) {
|
||||
this.bits = Integer.valueOf(bits);
|
||||
@@ -96,7 +96,7 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
|
||||
/**
|
||||
* @param type must not be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public GeospatialIndex typed(GeoSpatialIndexType type) {
|
||||
|
||||
@@ -108,7 +108,7 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
|
||||
/**
|
||||
* @param bucketSize
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public GeospatialIndex withBucketSize(double bucketSize) {
|
||||
this.bucketSize = bucketSize;
|
||||
@@ -116,8 +116,8 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fieldName.
|
||||
* @return
|
||||
* @param fieldName
|
||||
* @return this.
|
||||
*/
|
||||
public GeospatialIndex withAdditionalField(String fieldName) {
|
||||
this.additionalField = fieldName;
|
||||
@@ -128,7 +128,7 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
* Only index the documents in a collection that meet a specified {@link IndexFilter filter expression}.
|
||||
*
|
||||
* @param filter can be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.com/manual/core/index-partial/">https://docs.mongodb.com/manual/core/index-partial/</a>
|
||||
* @since 1.10
|
||||
@@ -146,7 +146,7 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
* index.
|
||||
*
|
||||
* @param collation can be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 2.0
|
||||
*/
|
||||
public GeospatialIndex collation(@Nullable Collation collation) {
|
||||
@@ -155,6 +155,11 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.index.IndexDefinition#getIndexKeys()
|
||||
*/
|
||||
@Override
|
||||
public Document getIndexKeys() {
|
||||
|
||||
Document document = new Document();
|
||||
@@ -184,6 +189,11 @@ public class GeospatialIndex implements IndexDefinition {
|
||||
return document;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.index.IndexDefinition#getIndexOptions()
|
||||
*/
|
||||
@Override
|
||||
public Document getIndexOptions() {
|
||||
|
||||
Document document = new Document();
|
||||
|
||||
@@ -40,7 +40,7 @@ public class HashedIndex implements IndexDefinition {
|
||||
* Creates a new {@link HashedIndex} for the given field.
|
||||
*
|
||||
* @param field must not be {@literal null} nor empty.
|
||||
* @return
|
||||
* @return new instance of {@link HashedIndex}.
|
||||
*/
|
||||
public static HashedIndex hashed(String field) {
|
||||
return new HashedIndex(field);
|
||||
|
||||
@@ -73,7 +73,7 @@ public class Index implements IndexDefinition {
|
||||
/**
|
||||
* Reject all documents that contain a duplicate value for the indexed field.
|
||||
*
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/index-unique/">https://docs.mongodb.org/manual/core/index-unique/</a>
|
||||
*/
|
||||
@@ -85,7 +85,7 @@ public class Index implements IndexDefinition {
|
||||
/**
|
||||
* Skip over any document that is missing the indexed field.
|
||||
*
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/index-sparse/">https://docs.mongodb.org/manual/core/index-sparse/</a>
|
||||
*/
|
||||
@@ -97,7 +97,7 @@ public class Index implements IndexDefinition {
|
||||
/**
|
||||
* Build the index in background (non blocking).
|
||||
*
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 1.5
|
||||
*/
|
||||
public Index background() {
|
||||
@@ -110,7 +110,7 @@ public class Index implements IndexDefinition {
|
||||
* Specifies TTL in seconds.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 1.5
|
||||
*/
|
||||
public Index expire(long value) {
|
||||
@@ -135,8 +135,8 @@ public class Index implements IndexDefinition {
|
||||
* Specifies TTL with given {@link TimeUnit}.
|
||||
*
|
||||
* @param value
|
||||
* @param unit
|
||||
* @return
|
||||
* @param unit must not be {@literal null}.
|
||||
* @return this.
|
||||
* @since 1.5
|
||||
*/
|
||||
public Index expire(long value, TimeUnit unit) {
|
||||
@@ -150,7 +150,7 @@ public class Index implements IndexDefinition {
|
||||
* Only index the documents in a collection that meet a specified {@link IndexFilter filter expression}.
|
||||
*
|
||||
* @param filter can be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.com/manual/core/index-partial/">https://docs.mongodb.com/manual/core/index-partial/</a>
|
||||
* @since 1.10
|
||||
@@ -168,7 +168,7 @@ public class Index implements IndexDefinition {
|
||||
* index.
|
||||
*
|
||||
* @param collation can be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 2.0
|
||||
*/
|
||||
public Index collation(@Nullable Collation collation) {
|
||||
@@ -192,6 +192,10 @@ public class Index implements IndexDefinition {
|
||||
return document;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.index.IndexDefinition#getIndexOptions()
|
||||
*/
|
||||
public Document getIndexOptions() {
|
||||
|
||||
Document document = new Document();
|
||||
|
||||
@@ -24,7 +24,17 @@ import org.bson.Document;
|
||||
*/
|
||||
public interface IndexDefinition {
|
||||
|
||||
/**
|
||||
* Get the {@link Document} containing properties covered by the index.
|
||||
*
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
Document getIndexKeys();
|
||||
|
||||
/**
|
||||
* Get the index properties such as {@literal unique},...
|
||||
*
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
Document getIndexOptions();
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public final class IndexField {
|
||||
* Creates a geo {@link IndexField} for the given key.
|
||||
*
|
||||
* @param key must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return new instance of {@link IndexField}.
|
||||
*/
|
||||
public static IndexField geo(String key) {
|
||||
return new IndexField(key, null, Type.GEO);
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface IndexFilter {
|
||||
/**
|
||||
* Get the raw (unmapped) filter expression.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
Document getFilterObject();
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ public class IndexInfo {
|
||||
/**
|
||||
* Creates new {@link IndexInfo} parsing required properties from the given {@literal sourceDocument}.
|
||||
*
|
||||
* @param sourceDocument
|
||||
* @return
|
||||
* @param sourceDocument never {@literal null}.
|
||||
* @return new instance of {@link IndexInfo}.
|
||||
* @since 1.10
|
||||
*/
|
||||
public static IndexInfo indexInfoOf(Document sourceDocument) {
|
||||
@@ -135,7 +135,7 @@ public class IndexInfo {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sourceDocument
|
||||
* @param sourceDocument never {@literal null}.
|
||||
* @return the {@link String} representation of the partial filter {@link Document}.
|
||||
* @since 2.1.11
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,7 @@ public interface IndexResolver {
|
||||
* Find and create {@link IndexDefinition}s for properties of given {@link TypeInformation}. {@link IndexDefinition}s
|
||||
* are created for properties and types with {@link Indexed}, {@link CompoundIndexes} or {@link GeoSpatialIndexed}.
|
||||
*
|
||||
* @param typeInformation
|
||||
* @param typeInformation must not be {@literal null}.
|
||||
* @return Empty {@link Iterable} in case no {@link IndexDefinition} could be resolved for type.
|
||||
*/
|
||||
Iterable<? extends IndexDefinition> resolveIndexFor(TypeInformation<?> typeInformation);
|
||||
@@ -61,7 +61,7 @@ public interface IndexResolver {
|
||||
* Find and create {@link IndexDefinition}s for properties of given {@link TypeInformation}. {@link IndexDefinition}s
|
||||
* are created for properties and types with {@link Indexed}, {@link CompoundIndexes} or {@link GeoSpatialIndexed}.
|
||||
*
|
||||
* @param entityType
|
||||
* @param entityType must not be {@literal null}.
|
||||
* @return Empty {@link Iterable} in case no {@link IndexDefinition} could be resolved for type.
|
||||
* @see 2.2
|
||||
*/
|
||||
|
||||
@@ -39,25 +39,30 @@ public @interface Indexed {
|
||||
/**
|
||||
* If set to true reject all documents that contain a duplicate value for the indexed field.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/index-unique/">https://docs.mongodb.org/manual/core/index-unique/</a>
|
||||
*/
|
||||
boolean unique() default false;
|
||||
|
||||
/**
|
||||
* The index sort direction.
|
||||
*
|
||||
* @return {@link IndexDirection#ASCENDING} by default.
|
||||
*/
|
||||
IndexDirection direction() default IndexDirection.ASCENDING;
|
||||
|
||||
/**
|
||||
* If set to true index will skip over any document that is missing the indexed field.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/index-sparse/">https://docs.mongodb.org/manual/core/index-sparse/</a>
|
||||
*/
|
||||
boolean sparse() default false;
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/index-creation/#index-creation-duplicate-dropping">https://docs.mongodb.org/manual/core/index-creation/#index-creation-duplicate-dropping</a>
|
||||
* @deprecated since 2.1. No longer supported by MongoDB as of server version 3.0.
|
||||
@@ -105,7 +110,7 @@ public @interface Indexed {
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
* @return
|
||||
* @return empty String by default.
|
||||
*/
|
||||
String name() default "";
|
||||
|
||||
@@ -113,7 +118,7 @@ public @interface Indexed {
|
||||
* If set to {@literal true} then MongoDB will ignore the given index name and instead generate a new name. Defaults
|
||||
* to {@literal false}.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean useGeneratedName() default false;
|
||||
@@ -121,7 +126,7 @@ public @interface Indexed {
|
||||
/**
|
||||
* If {@literal true} the index will be created in the background.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/core/indexes/#background-construction">https://docs.mongodb.org/manual/core/indexes/#background-construction</a>
|
||||
*/
|
||||
@@ -130,7 +135,7 @@ public @interface Indexed {
|
||||
/**
|
||||
* Configures the number of seconds after which the collection should expire. Defaults to -1 for no expiry.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal -1} by default.
|
||||
* @see <a href=
|
||||
* "https://docs.mongodb.org/manual/tutorial/expire-data/">https://docs.mongodb.org/manual/tutorial/expire-data/</a>
|
||||
*/
|
||||
|
||||
@@ -77,7 +77,7 @@ public class MongoPersistentEntityIndexCreator implements ApplicationListener<Ma
|
||||
* {@link MongoDatabaseFactory}.
|
||||
*
|
||||
* @param mappingContext must not be {@literal null}.
|
||||
* @param mongoDbFactory must not be {@literal null}.
|
||||
* @param indexOperationsProvider must not be {@literal null}.
|
||||
* @param indexResolver must not be {@literal null}.
|
||||
*/
|
||||
public MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext,
|
||||
|
||||
@@ -261,7 +261,7 @@ public class BasicMongoPersistentEntity<T> extends BasicPersistentEntity<T, Mong
|
||||
* ambiguity a @see {@link MappingException} is thrown.
|
||||
*
|
||||
* @param property - the new id property candidate
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Override
|
||||
protected MongoPersistentProperty returnPropertyIfBetterIdPropertyCandidateOrNull(MongoPersistentProperty property) {
|
||||
@@ -313,7 +313,7 @@ public class BasicMongoPersistentEntity<T> extends BasicPersistentEntity<T, Mong
|
||||
* {@link LiteralExpression} (indicating that no subsequent evaluation is necessary).
|
||||
*
|
||||
* @param potentialExpression can be {@literal null}
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
private static Expression detectExpression(@Nullable String potentialExpression) {
|
||||
|
||||
@@ -67,10 +67,10 @@ public class BasicMongoPersistentProperty extends AnnotationBasedPersistentPrope
|
||||
/**
|
||||
* Creates a new {@link BasicMongoPersistentProperty}.
|
||||
*
|
||||
* @param property
|
||||
* @param owner
|
||||
* @param simpleTypeHolder
|
||||
* @param fieldNamingStrategy
|
||||
* @param property the source property.
|
||||
* @param owner the owing entity.
|
||||
* @param simpleTypeHolder must not be {@literal null}.
|
||||
* @param fieldNamingStrategy can be {@literal null}.
|
||||
*/
|
||||
public BasicMongoPersistentProperty(Property property, MongoPersistentEntity<?> owner,
|
||||
SimpleTypeHolder simpleTypeHolder, @Nullable FieldNamingStrategy fieldNamingStrategy) {
|
||||
|
||||
@@ -40,13 +40,13 @@ public class CachingMongoPersistentProperty extends BasicMongoPersistentProperty
|
||||
/**
|
||||
* Creates a new {@link CachingMongoPersistentProperty}.
|
||||
*
|
||||
* @param property
|
||||
* @param owner
|
||||
* @param simpleTypeHolder
|
||||
* @param fieldNamingStrategy
|
||||
* @param property must not be {@literal null}.
|
||||
* @param owner must not be {@literal null}.
|
||||
* @param simpleTypeHolder must not be {@literal null}.
|
||||
* @param fieldNamingStrategy can be {@literal null}.
|
||||
*/
|
||||
public CachingMongoPersistentProperty(Property property, MongoPersistentEntity<?> owner,
|
||||
SimpleTypeHolder simpleTypeHolder, FieldNamingStrategy fieldNamingStrategy) {
|
||||
SimpleTypeHolder simpleTypeHolder, @Nullable FieldNamingStrategy fieldNamingStrategy) {
|
||||
super(property, owner, simpleTypeHolder, fieldNamingStrategy);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,14 +39,14 @@ public @interface DBRef {
|
||||
/**
|
||||
* The database the referred entity resides in.
|
||||
*
|
||||
* @return
|
||||
* @return empty String by default.
|
||||
*/
|
||||
String db() default "";
|
||||
|
||||
/**
|
||||
* Controls whether the referenced entity should be loaded lazily. This defaults to {@literal false}.
|
||||
*
|
||||
* @return
|
||||
* @return {@literal false} by default.
|
||||
*/
|
||||
boolean lazy() default false;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public @interface Document {
|
||||
/**
|
||||
* Defines the default language to be used with this document.
|
||||
*
|
||||
* @return
|
||||
* @return an empty String by default.
|
||||
* @since 1.6
|
||||
*/
|
||||
String language() default "";
|
||||
|
||||
@@ -70,7 +70,7 @@ public interface MongoPersistentEntity<T> extends PersistentEntity<T, MongoPersi
|
||||
|
||||
/**
|
||||
* @return {@literal true} if the entity is annotated with
|
||||
* {@link org.springframework.data.mongodb.core.mapping.Collation}.
|
||||
* {@link org.springframework.data.mongodb.core.query.Collation}.
|
||||
* @since 2.2
|
||||
*/
|
||||
default boolean hasCollation() {
|
||||
|
||||
@@ -47,7 +47,7 @@ public abstract class AbstractDeleteEvent<T> extends MongoMappingEvent<Document>
|
||||
/**
|
||||
* Returns the type for which the {@link AbstractDeleteEvent} shall be invoked for.
|
||||
*
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
public Class<T> getType() {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class AfterDeleteEvent<T> extends AbstractDeleteEvent<T> {
|
||||
/**
|
||||
* Creates a new {@link AfterDeleteEvent} for the given {@link Document}, type and collectionName.
|
||||
*
|
||||
* @param dbo must not be {@literal null}.
|
||||
* @param document must not be {@literal null}.
|
||||
* @param type may be {@literal null}.
|
||||
* @param collectionName must not be {@literal null}.
|
||||
* @since 1.8
|
||||
|
||||
@@ -51,7 +51,7 @@ public class AfterLoadEvent<T> extends MongoMappingEvent<Document> {
|
||||
/**
|
||||
* Returns the type for which the {@link AfterLoadEvent} shall be invoked for.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Class<T> getType() {
|
||||
return type;
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface Cancelable {
|
||||
/**
|
||||
* Abort and free resources.
|
||||
*
|
||||
* @throws DataAccessResourceFailureException
|
||||
* @throws DataAccessResourceFailureException if operation cannot be canceled.
|
||||
*/
|
||||
void cancel() throws DataAccessResourceFailureException;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ abstract class CursorReadingTask<T, R> implements Task {
|
||||
* exception.
|
||||
*
|
||||
* @param callback must not be {@literal null}.
|
||||
* @param <T>
|
||||
* @param <V>
|
||||
* @return can be {@literal null}.
|
||||
* @throws RuntimeException The potentially translated exception.
|
||||
*/
|
||||
|
||||
@@ -77,7 +77,7 @@ public interface Message<S, T> {
|
||||
/**
|
||||
* The database name the message originates from.
|
||||
*
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
public String getDatabaseName() {
|
||||
@@ -87,7 +87,7 @@ public interface Message<S, T> {
|
||||
/**
|
||||
* The collection name the message originates from.
|
||||
*
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
public String getCollectionName() {
|
||||
|
||||
@@ -94,7 +94,7 @@ public interface MessageListenerContainer extends SmartLifecycle {
|
||||
* Errors during {@link Message} retrieval lead to {@link Subscription#cancel() cannelation} of the underlying task.
|
||||
*
|
||||
* @param request must not be {@literal null}.
|
||||
* @param type the exact target or a more concrete type of the {@link Message#getBody()}.
|
||||
* @param bodyType the exact target or a more concrete type of the {@link Message#getBody()}.
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
<S, T> Subscription register(SubscriptionRequest<S, ? super T, ? extends RequestOptions> request, Class<T> bodyType);
|
||||
@@ -127,7 +127,7 @@ public interface MessageListenerContainer extends SmartLifecycle {
|
||||
* Errors during {@link Message} retrieval are delegated to the given {@link ErrorHandler}.
|
||||
*
|
||||
* @param request must not be {@literal null}.
|
||||
* @param type the exact target or a more concrete type of the {@link Message#getBody()}. Must not be {@literal null}.
|
||||
* @param bodyType the exact target or a more concrete type of the {@link Message#getBody()}. Must not be {@literal null}.
|
||||
* @param errorHandler the callback to invoke when retrieving the {@link Message} from the data source fails for some
|
||||
* reason.
|
||||
* @return never {@literal null}.
|
||||
|
||||
@@ -81,7 +81,7 @@ public class Collation {
|
||||
* {@link java.util.Locale#getVariant()}.
|
||||
*
|
||||
* @param locale must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Collation}.
|
||||
*/
|
||||
public static Collation of(Locale locale) {
|
||||
|
||||
@@ -102,7 +102,7 @@ public class Collation {
|
||||
* Create new {@link Collation} with locale set to the given ICU language.
|
||||
*
|
||||
* @param language must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Collation}.
|
||||
*/
|
||||
public static Collation of(String language) {
|
||||
return of(CollationLocale.of(language));
|
||||
@@ -112,7 +112,7 @@ public class Collation {
|
||||
* Create new {@link Collation} with locale set to the given {@link CollationLocale}.
|
||||
*
|
||||
* @param locale must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Collation}.
|
||||
*/
|
||||
public static Collation of(CollationLocale locale) {
|
||||
return new Collation(locale);
|
||||
@@ -139,7 +139,7 @@ public class Collation {
|
||||
* Create new {@link Collation} from values in {@link Document}.
|
||||
*
|
||||
* @param source must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Collation}.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/collation/#collation-document">MongoDB Reference -
|
||||
* Collation Document</a>
|
||||
*/
|
||||
@@ -181,7 +181,7 @@ public class Collation {
|
||||
/**
|
||||
* Set the level of comparison to perform.
|
||||
*
|
||||
* @param strength
|
||||
* @param strength comparison level.
|
||||
* @return new {@link Collation}.
|
||||
*/
|
||||
public Collation strength(int strength) {
|
||||
@@ -206,7 +206,7 @@ public class Collation {
|
||||
/**
|
||||
* Set whether to include {@code caseLevel} comparison. <br />
|
||||
*
|
||||
* @param caseLevel
|
||||
* @param caseLevel use {@literal true} to enable {@code caseLevel} comparison.
|
||||
* @return new {@link Collation}.
|
||||
*/
|
||||
public Collation caseLevel(boolean caseLevel) {
|
||||
@@ -220,7 +220,7 @@ public class Collation {
|
||||
* Set the flag that determines sort order of case differences during tertiary level comparisons.
|
||||
*
|
||||
* @param caseFirst must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Collation}.
|
||||
*/
|
||||
public Collation caseFirst(String caseFirst) {
|
||||
return caseFirst(new CaseFirst(caseFirst));
|
||||
@@ -229,8 +229,8 @@ public class Collation {
|
||||
/**
|
||||
* Set the flag that determines sort order of case differences during tertiary level comparisons.
|
||||
*
|
||||
* @param caseFirst must not be {@literal null}.
|
||||
* @return
|
||||
* @param sort must not be {@literal null}.
|
||||
* @return new instance of {@link Collation}.
|
||||
*/
|
||||
public Collation caseFirst(CaseFirst sort) {
|
||||
|
||||
@@ -372,7 +372,7 @@ public class Collation {
|
||||
/**
|
||||
* Get the {@link Document} representation of the {@link Collation}.
|
||||
*
|
||||
* @return
|
||||
* @return the native MongoDB {@link Document} representation of the {@link Collation}.
|
||||
*/
|
||||
public Document toDocument() {
|
||||
return map(toMongoDocumentConverter());
|
||||
@@ -381,7 +381,7 @@ public class Collation {
|
||||
/**
|
||||
* Get the {@link com.mongodb.client.model.Collation} representation of the {@link Collation}.
|
||||
*
|
||||
* @return
|
||||
* @return he native MongoDB representation of the {@link Collation}.
|
||||
*/
|
||||
public com.mongodb.client.model.Collation toMongoCollation() {
|
||||
return map(toMongoCollationConverter());
|
||||
@@ -390,9 +390,9 @@ public class Collation {
|
||||
/**
|
||||
* Transform {@code this} {@link Collation} by applying a {@link Converter}.
|
||||
*
|
||||
* @param mapper
|
||||
* @param mapper must not be {@literal null}.
|
||||
* @param <R>
|
||||
* @return
|
||||
* @return the converted result.
|
||||
*/
|
||||
public <R> R map(Converter<? super Collation, ? extends R> mapper) {
|
||||
return mapper.convert(this);
|
||||
@@ -771,7 +771,7 @@ public class Collation {
|
||||
* Create new {@link CollationLocale} for given language.
|
||||
*
|
||||
* @param language must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link CollationLocale}.
|
||||
*/
|
||||
public static CollationLocale of(String language) {
|
||||
|
||||
@@ -794,7 +794,7 @@ public class Collation {
|
||||
/**
|
||||
* Get the string representation.
|
||||
*
|
||||
* @return
|
||||
* @return the collation {@link String} in Mongo ICU format.
|
||||
*/
|
||||
public String asString() {
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import java.util.stream.Collectors;
|
||||
import org.bson.BsonRegularExpression;
|
||||
import org.bson.Document;
|
||||
import org.bson.types.Binary;
|
||||
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.data.geo.Circle;
|
||||
import org.springframework.data.geo.Point;
|
||||
@@ -105,8 +104,8 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Static factory method to create a Criteria using the provided key
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key the property or field name.
|
||||
* @return new instance of {@link Criteria}.
|
||||
*/
|
||||
public static Criteria where(String key) {
|
||||
return new Criteria(key);
|
||||
@@ -116,7 +115,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
* Static factory method to create a {@link Criteria} matching an example object.
|
||||
*
|
||||
* @param example must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Criteria}.
|
||||
* @see Criteria#alike(Example)
|
||||
* @since 1.8
|
||||
*/
|
||||
@@ -128,7 +127,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
* Static factory method to create a {@link Criteria} matching an example object.
|
||||
*
|
||||
* @param example must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Criteria}.
|
||||
* @see Criteria#alike(Example)
|
||||
* @since 1.8
|
||||
*/
|
||||
@@ -153,7 +152,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Static factory method to create a Criteria using the provided key
|
||||
*
|
||||
* @return
|
||||
* @return new instance of {@link Criteria}.
|
||||
*/
|
||||
public Criteria and(String key) {
|
||||
return new Criteria(this.criteriaChain, key);
|
||||
@@ -162,10 +161,10 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Creates a criterion using equality
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param value can be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public Criteria is(@Nullable Object o) {
|
||||
public Criteria is(@Nullable Object value) {
|
||||
|
||||
if (!isValue.equals(NOT_SET)) {
|
||||
throw new InvalidMongoDbApiUsageException(
|
||||
@@ -176,7 +175,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
throw new InvalidMongoDbApiUsageException("Invalid query: 'not' can't be used with 'is' - use 'ne' instead.");
|
||||
}
|
||||
|
||||
this.isValue = o;
|
||||
this.isValue = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -187,120 +186,120 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Creates a criterion using the {@literal $ne} operator.
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param value can be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/ne/">MongoDB Query operator: $ne</a>
|
||||
*/
|
||||
public Criteria ne(@Nullable Object o) {
|
||||
criteria.put("$ne", o);
|
||||
public Criteria ne(@Nullable Object value) {
|
||||
criteria.put("$ne", value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $lt} operator.
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param value must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/lt/">MongoDB Query operator: $lt</a>
|
||||
*/
|
||||
public Criteria lt(Object o) {
|
||||
criteria.put("$lt", o);
|
||||
public Criteria lt(Object value) {
|
||||
criteria.put("$lt", value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $lte} operator.
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param value must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/lte/">MongoDB Query operator: $lte</a>
|
||||
*/
|
||||
public Criteria lte(Object o) {
|
||||
criteria.put("$lte", o);
|
||||
public Criteria lte(Object value) {
|
||||
criteria.put("$lte", value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $gt} operator.
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param value must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/gt/">MongoDB Query operator: $gt</a>
|
||||
*/
|
||||
public Criteria gt(Object o) {
|
||||
criteria.put("$gt", o);
|
||||
public Criteria gt(Object value) {
|
||||
criteria.put("$gt", value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $gte} operator.
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param value can be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/gte/">MongoDB Query operator: $gte</a>
|
||||
*/
|
||||
public Criteria gte(Object o) {
|
||||
criteria.put("$gte", o);
|
||||
public Criteria gte(Object value) {
|
||||
criteria.put("$gte", value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $in} operator.
|
||||
*
|
||||
* @param o the values to match against
|
||||
* @return
|
||||
* @param values the values to match against
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/in/">MongoDB Query operator: $in</a>
|
||||
*/
|
||||
public Criteria in(Object... o) {
|
||||
if (o.length > 1 && o[1] instanceof Collection) {
|
||||
public Criteria in(Object... values) {
|
||||
if (values.length > 1 && values[1] instanceof Collection) {
|
||||
throw new InvalidMongoDbApiUsageException(
|
||||
"You can only pass in one argument of type " + o[1].getClass().getName());
|
||||
"You can only pass in one argument of type " + values[1].getClass().getName());
|
||||
}
|
||||
criteria.put("$in", Arrays.asList(o));
|
||||
criteria.put("$in", Arrays.asList(values));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $in} operator.
|
||||
*
|
||||
* @param c the collection containing the values to match against
|
||||
* @return
|
||||
* @param values the collection containing the values to match against
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/in/">MongoDB Query operator: $in</a>
|
||||
*/
|
||||
public Criteria in(Collection<?> c) {
|
||||
criteria.put("$in", c);
|
||||
public Criteria in(Collection<?> values) {
|
||||
criteria.put("$in", values);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $nin} operator.
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param values
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/nin/">MongoDB Query operator: $nin</a>
|
||||
*/
|
||||
public Criteria nin(Object... o) {
|
||||
return nin(Arrays.asList(o));
|
||||
public Criteria nin(Object... values) {
|
||||
return nin(Arrays.asList(values));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $nin} operator.
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param values must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/nin/">MongoDB Query operator: $nin</a>
|
||||
*/
|
||||
public Criteria nin(Collection<?> o) {
|
||||
criteria.put("$nin", o);
|
||||
public Criteria nin(Collection<?> values) {
|
||||
criteria.put("$nin", values);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $mod} operator.
|
||||
*
|
||||
* @param value
|
||||
* @param remainder
|
||||
* @return
|
||||
* @param value must not be {@literal null}.
|
||||
* @param remainder must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/mod/">MongoDB Query operator: $mod</a>
|
||||
*/
|
||||
public Criteria mod(Number value, Number remainder) {
|
||||
@@ -314,59 +313,59 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Creates a criterion using the {@literal $all} operator.
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param values must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/all/">MongoDB Query operator: $all</a>
|
||||
*/
|
||||
public Criteria all(Object... o) {
|
||||
return all(Arrays.asList(o));
|
||||
public Criteria all(Object... values) {
|
||||
return all(Arrays.asList(values));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $all} operator.
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
* @param values must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/all/">MongoDB Query operator: $all</a>
|
||||
*/
|
||||
public Criteria all(Collection<?> o) {
|
||||
criteria.put("$all", o);
|
||||
public Criteria all(Collection<?> values) {
|
||||
criteria.put("$all", values);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $size} operator.
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
* @param size
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/size/">MongoDB Query operator: $size</a>
|
||||
*/
|
||||
public Criteria size(int s) {
|
||||
criteria.put("$size", s);
|
||||
public Criteria size(int size) {
|
||||
criteria.put("$size", size);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $exists} operator.
|
||||
*
|
||||
* @param b
|
||||
* @return
|
||||
* @param value
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/exists/">MongoDB Query operator: $exists</a>
|
||||
*/
|
||||
public Criteria exists(boolean b) {
|
||||
criteria.put("$exists", b);
|
||||
public Criteria exists(boolean value) {
|
||||
criteria.put("$exists", value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the {@literal $type} operator.
|
||||
*
|
||||
* @param t
|
||||
* @return
|
||||
* @param typeNumber
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/type/">MongoDB Query operator: $type</a>
|
||||
*/
|
||||
public Criteria type(int t) {
|
||||
criteria.put("$type", t);
|
||||
public Criteria type(int typeNumber) {
|
||||
criteria.put("$type", typeNumber);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -374,7 +373,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
* Creates a criterion using the {@literal $type} operator.
|
||||
*
|
||||
* @param types must not be {@literal null}.
|
||||
* @return this
|
||||
* @return this.
|
||||
* @since 2.1
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/type/">MongoDB Query operator: $type</a>
|
||||
*/
|
||||
@@ -390,7 +389,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Creates a criterion using the {@literal $not} meta operator which affects the clause directly following
|
||||
*
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/not/">MongoDB Query operator: $not</a>
|
||||
*/
|
||||
public Criteria not() {
|
||||
@@ -400,8 +399,8 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Creates a criterion using the {@literal $not} operator.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @param value can be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/not/">MongoDB Query operator: $not</a>
|
||||
*/
|
||||
private Criteria not(@Nullable Object value) {
|
||||
@@ -412,31 +411,31 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Creates a criterion using a {@literal $regex} operator.
|
||||
*
|
||||
* @param re
|
||||
* @return
|
||||
* @param regex must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/regex/">MongoDB Query operator: $regex</a>
|
||||
*/
|
||||
public Criteria regex(String re) {
|
||||
return regex(re, null);
|
||||
public Criteria regex(String regex) {
|
||||
return regex(regex, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using a {@literal $regex} and {@literal $options} operator.
|
||||
*
|
||||
* @param re
|
||||
* @param options
|
||||
* @return
|
||||
* @param regex must not be {@literal null}.
|
||||
* @param options can be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/regex/">MongoDB Query operator: $regex</a>
|
||||
*/
|
||||
public Criteria regex(String re, @Nullable String options) {
|
||||
return regex(toPattern(re, options));
|
||||
public Criteria regex(String regex, @Nullable String options) {
|
||||
return regex(toPattern(regex, options));
|
||||
}
|
||||
|
||||
/**
|
||||
* Syntactical sugar for {@link #is(Object)} making obvious that we create a regex predicate.
|
||||
*
|
||||
* @param pattern
|
||||
* @return
|
||||
* @param pattern must not be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public Criteria regex(Pattern pattern) {
|
||||
|
||||
@@ -450,6 +449,12 @@ public class Criteria implements CriteriaDefinition {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use a MongoDB native {@link BsonRegularExpression}.
|
||||
*
|
||||
* @param regex must not be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public Criteria regex(BsonRegularExpression regex) {
|
||||
|
||||
if (lastOperatorWasNot()) {
|
||||
@@ -472,7 +477,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
* Mongo 2.4 and higher.
|
||||
*
|
||||
* @param circle must not be {@literal null}
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/geoWithin/">MongoDB Query operator:
|
||||
* $geoWithin</a>
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/centerSphere/">MongoDB Query operator:
|
||||
@@ -489,8 +494,8 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Creates a geospatial criterion using a {@literal $geoWithin} operation.
|
||||
*
|
||||
* @param shape
|
||||
* @return
|
||||
* @param shape must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/geoWithin/">MongoDB Query operator:
|
||||
* $geoWithin</a>
|
||||
*/
|
||||
@@ -506,7 +511,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
* Creates a geospatial criterion using a {@literal $near} operation.
|
||||
*
|
||||
* @param point must not be {@literal null}
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/near/">MongoDB Query operator: $near</a>
|
||||
*/
|
||||
public Criteria near(Point point) {
|
||||
@@ -522,7 +527,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
* higher.
|
||||
*
|
||||
* @param point must not be {@literal null}
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/nearSphere/">MongoDB Query operator:
|
||||
* $nearSphere</a>
|
||||
*/
|
||||
@@ -539,7 +544,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
* structure and the documents one. Requires MongoDB 2.4 or better.
|
||||
*
|
||||
* @param geoJson must not be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 1.8
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@@ -554,7 +559,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
* Creates a geo-spatial criterion using a {@literal $maxDistance} operation, for use with $near
|
||||
*
|
||||
* @param maxDistance
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/maxDistance/">MongoDB Query operator:
|
||||
* $maxDistance</a>
|
||||
*/
|
||||
@@ -574,7 +579,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
* {@literal $nearSphere}.
|
||||
*
|
||||
* @param minDistance
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 1.7
|
||||
*/
|
||||
public Criteria minDistance(double minDistance) {
|
||||
@@ -591,21 +596,21 @@ public class Criteria implements CriteriaDefinition {
|
||||
/**
|
||||
* Creates a criterion using the {@literal $elemMatch} operator
|
||||
*
|
||||
* @param c
|
||||
* @return
|
||||
* @param criteria must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/elemMatch/">MongoDB Query operator:
|
||||
* $elemMatch</a>
|
||||
*/
|
||||
public Criteria elemMatch(Criteria c) {
|
||||
criteria.put("$elemMatch", c.getCriteriaObject());
|
||||
public Criteria elemMatch(Criteria criteria) {
|
||||
this.criteria.put("$elemMatch", criteria.getCriteriaObject());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a criterion using the given object as a pattern.
|
||||
*
|
||||
* @param sample
|
||||
* @return
|
||||
* @param sample must not be {@literal null}.
|
||||
* @return this.
|
||||
* @since 1.8
|
||||
*/
|
||||
public Criteria alike(Example<?> sample) {
|
||||
@@ -657,7 +662,8 @@ public class Criteria implements CriteriaDefinition {
|
||||
* <p>
|
||||
*
|
||||
* @throws IllegalArgumentException if {@link #orOperator(Criteria...)} follows a not() call directly.
|
||||
* @param criteria
|
||||
* @param criteria must not be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public Criteria orOperator(Criteria... criteria) {
|
||||
BasicDBList bsonList = createCriteriaList(criteria);
|
||||
@@ -671,7 +677,8 @@ public class Criteria implements CriteriaDefinition {
|
||||
* <p>
|
||||
*
|
||||
* @throws IllegalArgumentException if {@link #norOperator(Criteria...)} follows a not() call directly.
|
||||
* @param criteria
|
||||
* @param criteria must not be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public Criteria norOperator(Criteria... criteria) {
|
||||
BasicDBList bsonList = createCriteriaList(criteria);
|
||||
@@ -685,7 +692,8 @@ public class Criteria implements CriteriaDefinition {
|
||||
* <p>
|
||||
*
|
||||
* @throws IllegalArgumentException if {@link #andOperator(Criteria...)} follows a not() call directly.
|
||||
* @param criteria
|
||||
* @param criteria must not be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public Criteria andOperator(Criteria... criteria) {
|
||||
BasicDBList bsonList = createCriteriaList(criteria);
|
||||
|
||||
@@ -67,7 +67,8 @@ public final class GeoCommand {
|
||||
* Returns the MongoDB command for the given {@link Shape}.
|
||||
*
|
||||
* @param shape must not be {@literal null}.
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @throws IllegalArgumentException for unknown {@link Shape}.
|
||||
*/
|
||||
private String getCommand(Shape shape) {
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class Query {
|
||||
* Static factory method to create a {@link Query} using the provided {@link CriteriaDefinition}.
|
||||
*
|
||||
* @param criteriaDefinition must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link Query}.
|
||||
* @since 1.6
|
||||
*/
|
||||
public static Query query(CriteriaDefinition criteriaDefinition) {
|
||||
@@ -90,7 +90,7 @@ public class Query {
|
||||
* Adds the given {@link CriteriaDefinition} to the current {@link Query}.
|
||||
*
|
||||
* @param criteriaDefinition must not be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 1.6
|
||||
*/
|
||||
public Query addCriteria(CriteriaDefinition criteriaDefinition) {
|
||||
@@ -124,7 +124,7 @@ public class Query {
|
||||
* Set number of documents to skip before returning results.
|
||||
*
|
||||
* @param skip
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public Query skip(long skip) {
|
||||
this.skip = skip;
|
||||
@@ -135,7 +135,7 @@ public class Query {
|
||||
* Limit the number of returned documents to {@code limit}.
|
||||
*
|
||||
* @param limit
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public Query limit(int limit) {
|
||||
this.limit = limit;
|
||||
@@ -147,7 +147,7 @@ public class Query {
|
||||
* json {@link Document} representation.
|
||||
*
|
||||
* @param hint must not be {@literal null} or empty.
|
||||
* @return
|
||||
* @return this.
|
||||
* @see Document#parse(String)
|
||||
*/
|
||||
public Query withHint(String hint) {
|
||||
@@ -161,7 +161,7 @@ public class Query {
|
||||
* Configures the query to use the given {@link Document hint} when being executed.
|
||||
*
|
||||
* @param hint must not be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 2.2
|
||||
*/
|
||||
public Query withHint(Document hint) {
|
||||
@@ -175,8 +175,8 @@ public class Query {
|
||||
* Sets the given pagination information on the {@link Query} instance. Will transparently set {@code skip} and
|
||||
* {@code limit} as well as applying the {@link Sort} instance defined with the {@link Pageable}.
|
||||
*
|
||||
* @param pageable
|
||||
* @return
|
||||
* @param pageable must not be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public Query with(Pageable pageable) {
|
||||
|
||||
@@ -193,8 +193,8 @@ public class Query {
|
||||
/**
|
||||
* Adds a {@link Sort} to the {@link Query} instance.
|
||||
*
|
||||
* @param sort
|
||||
* @return
|
||||
* @param sort must not be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public Query with(Sort sort) {
|
||||
|
||||
@@ -227,7 +227,7 @@ public class Query {
|
||||
*
|
||||
* @param type may not be {@literal null}
|
||||
* @param additionalTypes may not be {@literal null}
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public Query restrict(Class<?> type, Class<?>... additionalTypes) {
|
||||
|
||||
@@ -296,7 +296,7 @@ public class Query {
|
||||
/**
|
||||
* Get the number of documents to skip.
|
||||
*
|
||||
* @return
|
||||
* @return number of documents to skip
|
||||
*/
|
||||
public long getSkip() {
|
||||
return this.skip;
|
||||
@@ -305,14 +305,14 @@ public class Query {
|
||||
/**
|
||||
* Get the maximum number of documents to be return.
|
||||
*
|
||||
* @return
|
||||
* @return number of documents to return.
|
||||
*/
|
||||
public int getLimit() {
|
||||
return this.limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return can be {@literal null}.
|
||||
*/
|
||||
@Nullable
|
||||
public String getHint() {
|
||||
@@ -333,7 +333,7 @@ public class Query {
|
||||
|
||||
/**
|
||||
* @param timeout
|
||||
* @param timeUnit
|
||||
* @param timeUnit must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see Meta#setMaxTime(long, TimeUnit)
|
||||
* @since 1.6
|
||||
@@ -347,7 +347,7 @@ public class Query {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param timeout
|
||||
* @param timeout must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see Meta#setMaxTime(Duration)
|
||||
* @since 2.1
|
||||
@@ -361,7 +361,7 @@ public class Query {
|
||||
/**
|
||||
* Add a comment to the query that is propagated to the profile log.
|
||||
*
|
||||
* @param comment
|
||||
* @param comment must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see Meta#setComment(String)
|
||||
* @since 1.6
|
||||
@@ -456,7 +456,7 @@ public class Query {
|
||||
* Set the {@link Collation} applying language-specific rules for string comparison.
|
||||
*
|
||||
* @param collation can be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 2.0
|
||||
*/
|
||||
public Query collation(@Nullable Collation collation) {
|
||||
@@ -468,7 +468,7 @@ public class Query {
|
||||
/**
|
||||
* Get the {@link Collation} defining language-specific rules for string comparison.
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
* @since 2.0
|
||||
*/
|
||||
public Optional<Collation> getCollation() {
|
||||
|
||||
@@ -65,8 +65,8 @@ public class TextQuery extends Query {
|
||||
* For a full list of supported languages see the mongdodb reference manual for
|
||||
* <a href="https://docs.mongodb.org/manual/reference/text-search-languages/">Text Search Languages</a>.
|
||||
*
|
||||
* @param wordsAndPhrases
|
||||
* @param locale
|
||||
* @param wordsAndPhrases must not be {@literal null}.
|
||||
* @param locale can be {@literal null}.
|
||||
*/
|
||||
public TextQuery(String wordsAndPhrases, @Nullable Locale locale) {
|
||||
this(wordsAndPhrases, locale != null ? locale.getLanguage() : (String) null);
|
||||
@@ -75,7 +75,7 @@ public class TextQuery extends Query {
|
||||
/**
|
||||
* Creates new {@link TextQuery} for given {@link TextCriteria}.
|
||||
*
|
||||
* @param criteria.
|
||||
* @param criteria must not be {@literal null}.
|
||||
*/
|
||||
public TextQuery(TextCriteria criteria) {
|
||||
super(criteria);
|
||||
@@ -84,8 +84,8 @@ public class TextQuery extends Query {
|
||||
/**
|
||||
* Creates new {@link TextQuery} searching for given {@link TextCriteria}.
|
||||
*
|
||||
* @param criteria
|
||||
* @return
|
||||
* @param criteria must not be {@literal null}.
|
||||
* @return new instance of {@link TextQuery}.
|
||||
*/
|
||||
public static TextQuery queryText(TextCriteria criteria) {
|
||||
return new TextQuery(criteria);
|
||||
@@ -95,7 +95,7 @@ public class TextQuery extends Query {
|
||||
* Add sorting by text score. Will also add text score to returned fields.
|
||||
*
|
||||
* @see TextQuery#includeScore()
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public TextQuery sortByScore() {
|
||||
|
||||
@@ -107,7 +107,7 @@ public class TextQuery extends Query {
|
||||
/**
|
||||
* Add field {@literal score} holding the documents textScore to the returned fields.
|
||||
*
|
||||
* @return
|
||||
* @return this.
|
||||
*/
|
||||
public TextQuery includeScore() {
|
||||
|
||||
@@ -118,8 +118,8 @@ public class TextQuery extends Query {
|
||||
/**
|
||||
* Include text search document score in returned fields using the given fieldname.
|
||||
*
|
||||
* @param fieldname
|
||||
* @return
|
||||
* @param fieldname must not be {@literal null}.
|
||||
* @return this.
|
||||
*/
|
||||
public TextQuery includeScore(String fieldname) {
|
||||
|
||||
@@ -131,7 +131,7 @@ public class TextQuery extends Query {
|
||||
/**
|
||||
* Set the fieldname used for scoring.
|
||||
*
|
||||
* @param fieldName
|
||||
* @param fieldName must not be {@literal null}.
|
||||
*/
|
||||
public void setScoreFieldName(String fieldName) {
|
||||
this.scoreFieldName = fieldName;
|
||||
@@ -140,7 +140,7 @@ public class TextQuery extends Query {
|
||||
/**
|
||||
* Get the fieldname used for scoring
|
||||
*
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public String getScoreFieldName() {
|
||||
return scoreFieldName;
|
||||
|
||||
@@ -64,8 +64,8 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Static factory method to create an Update using the provided key
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key the field to update.
|
||||
* @return new instance of {@link Update}.
|
||||
*/
|
||||
public static Update update(String key, @Nullable Object value) {
|
||||
return new Update().set(key, value);
|
||||
@@ -80,7 +80,7 @@ public class Update implements UpdateDefinition {
|
||||
*
|
||||
* @param object the source {@link Document} to create the update from.
|
||||
* @param exclude the fields to exclude.
|
||||
* @return
|
||||
* @return new instance of {@link Update}.
|
||||
*/
|
||||
public static Update fromDocument(Document object, String... exclude) {
|
||||
|
||||
@@ -108,7 +108,7 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $set} update modifier
|
||||
*
|
||||
* @param key
|
||||
* @param key the field name.
|
||||
* @param value can be {@literal null}. In this case the property remains in the db with a {@literal null} value. To
|
||||
* remove it use {@link #unset(String)}.
|
||||
* @return this.
|
||||
@@ -122,9 +122,9 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $setOnInsert} update modifier
|
||||
*
|
||||
* @param key
|
||||
* @param key the field name.
|
||||
* @param value can be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/setOnInsert/">MongoDB Update operator:
|
||||
* $setOnInsert</a>
|
||||
*/
|
||||
@@ -136,8 +136,8 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $unset} update modifier
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/unset/">MongoDB Update operator: $unset</a>
|
||||
*/
|
||||
public Update unset(String key) {
|
||||
@@ -148,9 +148,9 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $inc} update modifier
|
||||
*
|
||||
* @param key
|
||||
* @param inc
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @param inc must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/inc/">MongoDB Update operator: $inc</a>
|
||||
*/
|
||||
public Update inc(String key, Number inc) {
|
||||
@@ -170,9 +170,9 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $push} update modifier
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @param value can be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/push/">MongoDB Update operator: $push</a>
|
||||
*/
|
||||
public Update push(String key, @Nullable Object value) {
|
||||
@@ -185,7 +185,7 @@ public class Update implements UpdateDefinition {
|
||||
* Allows creation of {@code $push} command for single or multiple (using {@code $each}) values as well as using
|
||||
* {@code $position}.
|
||||
*
|
||||
* @param key
|
||||
* @param key the field name.
|
||||
* @return {@link PushOperatorBuilder} for given key
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/push/">MongoDB Update operator: $push</a>
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/each/">MongoDB Update operator: $each</a>
|
||||
@@ -204,9 +204,9 @@ public class Update implements UpdateDefinition {
|
||||
* <b>Important:</b> As of MongoDB 3.6 {@code $pushAll} is not longer supported. Use {@code $push $each} instead.
|
||||
* {@link #push(String)}) returns a builder that can be used to populate the {@code $each} object.
|
||||
*
|
||||
* @param key
|
||||
* @param values
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @param values must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/pushAll/">MongoDB Update operator:
|
||||
* $pushAll</a>
|
||||
* @deprecated as of MongoDB 2.4. Removed in MongoDB 3.6. Use {@link #push(String) $push $each} instead.
|
||||
@@ -221,8 +221,8 @@ public class Update implements UpdateDefinition {
|
||||
* Update using {@code $addToSet} modifier. <br/>
|
||||
* Allows creation of {@code $push} command for single or multiple (using {@code $each}) values
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @return new instance of {@link AddToSetBuilder}.
|
||||
* @since 1.5
|
||||
*/
|
||||
public AddToSetBuilder addToSet(String key) {
|
||||
@@ -232,9 +232,9 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $addToSet} update modifier
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @param value can be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/addToSet/">MongoDB Update operator:
|
||||
* $addToSet</a>
|
||||
*/
|
||||
@@ -246,9 +246,9 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $pop} update modifier
|
||||
*
|
||||
* @param key
|
||||
* @param pos
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @param pos must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/pop/">MongoDB Update operator: $pop</a>
|
||||
*/
|
||||
public Update pop(String key, Position pos) {
|
||||
@@ -259,9 +259,9 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $pull} update modifier
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @param value can be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/pull/">MongoDB Update operator: $pull</a>
|
||||
*/
|
||||
public Update pull(String key, @Nullable Object value) {
|
||||
@@ -272,9 +272,9 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $pullAll} update modifier
|
||||
*
|
||||
* @param key
|
||||
* @param values
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @param values must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/pullAll/">MongoDB Update operator:
|
||||
* $pullAll</a>
|
||||
*/
|
||||
@@ -286,9 +286,9 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update using the {@literal $rename} update modifier
|
||||
*
|
||||
* @param oldName
|
||||
* @param newName
|
||||
* @return
|
||||
* @param oldName must not be {@literal null}.
|
||||
* @param newName must not be {@literal null}.
|
||||
* @return this.
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/rename/">MongoDB Update operator:
|
||||
* $rename</a>
|
||||
*/
|
||||
@@ -300,8 +300,8 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update given key to current date using {@literal $currentDate} modifier.
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @return this.
|
||||
* @since 1.6
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/currentDate/">MongoDB Update operator:
|
||||
* $currentDate</a>
|
||||
@@ -315,8 +315,8 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Update given key to current date using {@literal $currentDate : { $type : "timestamp" }} modifier.
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @return this.
|
||||
* @since 1.6
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/currentDate/">MongoDB Update operator:
|
||||
* $currentDate</a>
|
||||
@@ -332,7 +332,7 @@ public class Update implements UpdateDefinition {
|
||||
*
|
||||
* @param key must not be {@literal null}.
|
||||
* @param multiplier must not be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 1.7
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/mul/">MongoDB Update operator: $mul</a>
|
||||
*/
|
||||
@@ -348,7 +348,7 @@ public class Update implements UpdateDefinition {
|
||||
*
|
||||
* @param key must not be {@literal null}.
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 1.10
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/bson-type-comparison-order/">Comparison/Sort Order</a>
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/max/">MongoDB Update operator: $max</a>
|
||||
@@ -365,7 +365,7 @@ public class Update implements UpdateDefinition {
|
||||
*
|
||||
* @param key must not be {@literal null}.
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
* @return this.
|
||||
* @since 1.10
|
||||
* @see <a href="https://docs.mongodb.com/manual/reference/bson-type-comparison-order/">Comparison/Sort Order</a>
|
||||
* @see <a href="https://docs.mongodb.org/manual/reference/operator/update/min/">MongoDB Update operator: $min</a>
|
||||
@@ -380,8 +380,8 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* The operator supports bitwise {@code and}, bitwise {@code or}, and bitwise {@code xor} operations.
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @return this.
|
||||
* @since 1.7
|
||||
*/
|
||||
public BitwiseOperatorBuilder bitwise(String key) {
|
||||
@@ -391,9 +391,9 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Prevents a write operation that affects <strong>multiple</strong> documents from yielding to other reads or writes
|
||||
* once the first document is written. <br />
|
||||
* Use with {@link org.springframework.data.mongodb.core.MongoOperations#updateMulti(Query, Update, Class)}.
|
||||
* Use with {@link org.springframework.data.mongodb.core.MongoOperations#updateMulti(Query, UpdateDefinition, Class)}.
|
||||
*
|
||||
* @return never {@literal null}.
|
||||
* @return this.
|
||||
* @since 2.0
|
||||
*/
|
||||
public Update isolated() {
|
||||
@@ -497,8 +497,8 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Determine if a given {@code key} will be touched on execution.
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @return {@literal true} if given field is updated.
|
||||
*/
|
||||
public boolean modifies(String key) {
|
||||
return this.keysToUpdate.contains(key);
|
||||
@@ -507,8 +507,8 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Inspects given {@code key} for '$'.
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key the field name.
|
||||
* @return {@literal true} if given key is prefixed.
|
||||
*/
|
||||
private static boolean isKeyword(String key) {
|
||||
return StringUtils.startsWithIgnoreCase(key, "$");
|
||||
@@ -1046,8 +1046,8 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Propagates {@code $each} to {@code $addToSet}
|
||||
*
|
||||
* @param values
|
||||
* @return
|
||||
* @param values must not be {@literal null}.
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Update each(Object... values) {
|
||||
return Update.this.addToSet(this.key, new Each(values));
|
||||
@@ -1056,8 +1056,8 @@ public class Update implements UpdateDefinition {
|
||||
/**
|
||||
* Propagates {@link #value(Object)} to {@code $addToSet}
|
||||
*
|
||||
* @param values
|
||||
* @return
|
||||
* @param value
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Update value(Object value) {
|
||||
return Update.this.addToSet(this.key, value);
|
||||
@@ -1102,7 +1102,7 @@ public class Update implements UpdateDefinition {
|
||||
* Updates to the result of a bitwise and operation between the current value and the given one.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Update and(long value) {
|
||||
|
||||
@@ -1114,7 +1114,7 @@ public class Update implements UpdateDefinition {
|
||||
* Updates to the result of a bitwise or operation between the current value and the given one.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Update or(long value) {
|
||||
|
||||
@@ -1126,7 +1126,7 @@ public class Update implements UpdateDefinition {
|
||||
* Updates to the result of a bitwise xor operation between the current value and the given one.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
public Update xor(long value) {
|
||||
|
||||
|
||||
@@ -365,7 +365,6 @@ public class IdentifiableJsonSchemaProperty<T extends JsonSchemaObject> implemen
|
||||
/**
|
||||
* @param range must not be {@literal null}.
|
||||
* @return new instance of {@link ObjectJsonSchemaProperty}.
|
||||
* @see ObjectJsonSchemaObject#propertiesCount
|
||||
*/
|
||||
public ObjectJsonSchemaProperty propertiesCount(Range<Integer> range) {
|
||||
return new ObjectJsonSchemaProperty(identifier, jsonSchemaObjectDelegate.propertiesCount(range));
|
||||
@@ -1120,16 +1119,16 @@ public class IdentifiableJsonSchemaProperty<T extends JsonSchemaObject> implemen
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key
|
||||
* @return
|
||||
* @param keyId must not be {@literal null}.
|
||||
* @return new instance of {@link EncryptedJsonSchemaProperty}.
|
||||
*/
|
||||
public EncryptedJsonSchemaProperty keyId(String keyId) {
|
||||
return new EncryptedJsonSchemaProperty(targetProperty, algorithm, keyId, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param keyId
|
||||
* @return
|
||||
* @param keyId must not be {@literal null}.
|
||||
* @return new instance of {@link EncryptedJsonSchemaProperty}.
|
||||
*/
|
||||
public EncryptedJsonSchemaProperty keys(UUID... keyId) {
|
||||
return new EncryptedJsonSchemaProperty(targetProperty, algorithm, null, Arrays.asList(keyId));
|
||||
|
||||
@@ -218,8 +218,8 @@ public interface JsonSchemaProperty extends JsonSchemaObject {
|
||||
/**
|
||||
* Obtain a builder to create a {@link JsonSchemaProperty}.
|
||||
*
|
||||
* @param identifier
|
||||
* @return
|
||||
* @param identifier must not be {@literal null}.
|
||||
* @return new instance of {@link JsonSchemaPropertyBuilder}.
|
||||
*/
|
||||
static JsonSchemaPropertyBuilder named(String identifier) {
|
||||
return new JsonSchemaPropertyBuilder(identifier);
|
||||
@@ -248,7 +248,7 @@ public interface JsonSchemaProperty extends JsonSchemaObject {
|
||||
* Configure a {@link Type} for the property.
|
||||
*
|
||||
* @param type must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IdentifiableJsonSchemaProperty}.
|
||||
*/
|
||||
public IdentifiableJsonSchemaProperty<TypedJsonSchemaObject> ofType(Type type) {
|
||||
return new IdentifiableJsonSchemaProperty<>(identifier, TypedJsonSchemaObject.of(type));
|
||||
@@ -269,7 +269,7 @@ public interface JsonSchemaProperty extends JsonSchemaObject {
|
||||
* Configure a {@link TypedJsonSchemaObject} for the property.
|
||||
*
|
||||
* @param schemaObject must not be {@literal null}.
|
||||
* @return
|
||||
* @return new instance of {@link IdentifiableJsonSchemaProperty}.
|
||||
*/
|
||||
public IdentifiableJsonSchemaProperty<TypedJsonSchemaObject> with(TypedJsonSchemaObject schemaObject) {
|
||||
return new IdentifiableJsonSchemaProperty<>(identifier, schemaObject);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user