DATAMONGO-1564 - Polishing.
Fix JavaDoc references and minor a import formatting issue. Original pull request: #429.
This commit is contained in:
@@ -44,6 +44,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression {
|
||||
return toDocument(this.value, context);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Document toDocument(Object value, AggregationOperationContext context) {
|
||||
|
||||
Object valueToUse;
|
||||
@@ -79,6 +80,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression {
|
||||
return Fields.fields(fieldRefs).asList();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Object unpack(Object value, AggregationOperationContext context) {
|
||||
|
||||
if (value instanceof AggregationExpression) {
|
||||
@@ -122,13 +124,13 @@ abstract class AbstractAggregationExpression implements AggregationExpression {
|
||||
return Arrays.asList(this.value, value);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected java.util.Map<String, Object> append(String key, Object value) {
|
||||
|
||||
if (!(this.value instanceof java.util.Map)) {
|
||||
throw new IllegalArgumentException("o_O");
|
||||
}
|
||||
java.util.Map<String, Object> clone = new LinkedHashMap<String, Object>(
|
||||
(java.util.Map<String, Object>) this.value);
|
||||
java.util.Map<String, Object> clone = new LinkedHashMap<String, Object>((java.util.Map<String, Object>) this.value);
|
||||
clone.put(key, value);
|
||||
return clone;
|
||||
|
||||
@@ -142,7 +144,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression {
|
||||
if (value instanceof java.util.Map) {
|
||||
return new ArrayList<Object>(((java.util.Map) value).values());
|
||||
}
|
||||
return new ArrayList<Object>(Arrays.asList(value));
|
||||
return new ArrayList<Object>(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
protected abstract String getMongoMethod();
|
||||
|
||||
@@ -43,7 +43,7 @@ public class AccumulatorOperators {
|
||||
/**
|
||||
* Take the numeric value referenced resulting from given {@link AggregationExpression}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
public static AccumulatorOperatorFactory valueOf(AggregationExpression expression) {
|
||||
@@ -71,7 +71,7 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link ArrayOperatorFactory} for given {@link AggregationExpression}.
|
||||
* Creates new {@link AccumulatorOperatorFactory} for given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
*/
|
||||
@@ -83,7 +83,7 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated numeric value expression and calculates and
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and calculates and
|
||||
* returns the sum.
|
||||
*
|
||||
* @return
|
||||
@@ -93,7 +93,7 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated numeric value expression and returns the
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and returns the
|
||||
* average value.
|
||||
*
|
||||
* @return
|
||||
@@ -103,7 +103,7 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated numeric value expression and returns the
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and returns the
|
||||
* maximum value.
|
||||
*
|
||||
* @return
|
||||
@@ -113,7 +113,7 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated numeric value expression and returns the
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and returns the
|
||||
* minimum value.
|
||||
*
|
||||
* @return
|
||||
@@ -123,7 +123,7 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated numeric value expression and calculates the
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and calculates the
|
||||
* population standard deviation of the input values.
|
||||
*
|
||||
* @return
|
||||
@@ -133,7 +133,7 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated numeric value expression and calculates the
|
||||
* Creates new {@link AggregationExpression} that takes the associated numeric value expression and calculates the
|
||||
* sample standard deviation of the input values.
|
||||
*
|
||||
* @return
|
||||
@@ -214,9 +214,10 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AccumulatorOperators.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Document toDocument(Object value, AggregationOperationContext context) {
|
||||
|
||||
if (value instanceof List) {
|
||||
@@ -296,9 +297,10 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AccumulatorOperators.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Document toDocument(Object value, AggregationOperationContext context) {
|
||||
|
||||
if (value instanceof List) {
|
||||
@@ -378,9 +380,10 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AccumulatorOperators.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Document toDocument(Object value, AggregationOperationContext context) {
|
||||
|
||||
if (value instanceof List) {
|
||||
@@ -460,9 +463,10 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AccumulatorOperators.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Document toDocument(Object value, AggregationOperationContext context) {
|
||||
|
||||
if (value instanceof List) {
|
||||
@@ -542,9 +546,10 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AccumulatorOperators.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Document toDocument(Object value, AggregationOperationContext context) {
|
||||
|
||||
if (value instanceof List) {
|
||||
@@ -624,9 +629,10 @@ public class AccumulatorOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AccumulatorOperators.AbstractAggregationExpression#toDocument(java.lang.Object, org.springframework.data.mongodb.core.aggregation.AggregationOperationContext)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Document toDocument(Object value, AggregationOperationContext context) {
|
||||
|
||||
if (value instanceof List) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
* @since 1.7
|
||||
* @deprecated since 1.10. Please use {@link AggregationExpressions} instead.
|
||||
* @deprecated since 1.10. Please use {@link ArithmeticOperators} and {@link ComparisonOperators} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public enum AggregationFunctionExpressions {
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the absolute value of the associated number.
|
||||
* Creates new {@link AggregationExpression} that returns the absolute value of the associated number.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -96,7 +96,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that adds the value of {@literal fieldReference} to the associated
|
||||
* Creates new {@link AggregationExpression} that adds the value of {@literal fieldReference} to the associated
|
||||
* number.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -109,7 +109,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that adds the resulting value of the given
|
||||
* Creates new {@link AggregationExpression} that adds the resulting value of the given
|
||||
* {@link AggregationExpression} to the associated number.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -122,7 +122,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that adds the given {@literal value} to the associated number.
|
||||
* Creates new {@link AggregationExpression} that adds the given {@literal value} to the associated number.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
@@ -138,7 +138,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the smallest integer greater than or equal to the
|
||||
* Creates new {@link AggregationExpression} that returns the smallest integer greater than or equal to the
|
||||
* assoicated number.
|
||||
*
|
||||
* @return
|
||||
@@ -148,7 +148,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that ivides the associated number by number referenced via
|
||||
* Creates new {@link AggregationExpression} that ivides the associated number by number referenced via
|
||||
* {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -161,7 +161,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that divides the associated number by number extracted via
|
||||
* Creates new {@link AggregationExpression} that divides the associated number by number extracted via
|
||||
* {@literal expression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -174,7 +174,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that divides the associated number by given {@literal value}.
|
||||
* Creates new {@link AggregationExpression} that divides the associated number by given {@literal value}.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
@@ -190,7 +190,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that raises Euler’s number (i.e. e ) on the associated number.
|
||||
* Creates new {@link AggregationExpression} that raises Euler’s number (i.e. e ) on the associated number.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -199,7 +199,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the largest integer less than or equal to the associated
|
||||
* Creates new {@link AggregationExpression} that returns the largest integer less than or equal to the associated
|
||||
* number.
|
||||
*
|
||||
* @return
|
||||
@@ -209,7 +209,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that calculates the natural logarithm ln (i.e loge) of the assoicated
|
||||
* Creates new {@link AggregationExpression} that calculates the natural logarithm ln (i.e loge) of the assoicated
|
||||
* number.
|
||||
*
|
||||
* @return
|
||||
@@ -219,7 +219,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that calculates the log of the associated number in the specified base
|
||||
* Creates new {@link AggregationExpression} that calculates the log of the associated number in the specified base
|
||||
* referenced via {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -232,7 +232,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that calculates the log of the associated number in the specified base
|
||||
* Creates new {@link AggregationExpression} that calculates the log of the associated number in the specified base
|
||||
* extracted by given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -245,7 +245,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that calculates the log of a the associated number in the specified
|
||||
* Creates new {@link AggregationExpression} that calculates the log of a the associated number in the specified
|
||||
* {@literal base}.
|
||||
*
|
||||
* @param base must not be {@literal null}.
|
||||
@@ -262,7 +262,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that calculates the log base 10 for the associated number.
|
||||
* Creates new {@link AggregationExpression} that calculates the log base 10 for the associated number.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -271,7 +271,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that divides the associated number by another and returns the
|
||||
* Creates new {@link AggregationExpression} that divides the associated number by another and returns the
|
||||
* remainder.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -284,7 +284,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that divides the associated number by another and returns the
|
||||
* Creates new {@link AggregationExpression} that divides the associated number by another and returns the
|
||||
* remainder.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -297,7 +297,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that divides the associated number by another and returns the
|
||||
* Creates new {@link AggregationExpression} that divides the associated number by another and returns the
|
||||
* remainder.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
@@ -314,7 +314,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that multiplies the associated number with another.
|
||||
* Creates new {@link AggregationExpression} that multiplies the associated number with another.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
@@ -326,7 +326,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that multiplies the associated number with another.
|
||||
* Creates new {@link AggregationExpression} that multiplies the associated number with another.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
@@ -338,7 +338,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that multiplies the associated number with another.
|
||||
* Creates new {@link AggregationExpression} that multiplies the associated number with another.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
@@ -354,7 +354,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that raises the associated number to the specified exponent.
|
||||
* Creates new {@link AggregationExpression} that raises the associated number to the specified exponent.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
@@ -366,7 +366,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that raises the associated number to the specified exponent.
|
||||
* Creates new {@link AggregationExpression} that raises the associated number to the specified exponent.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
@@ -378,7 +378,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that raises the associated number to the specified exponent.
|
||||
* Creates new {@link AggregationExpression} that raises the associated number to the specified exponent.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
@@ -394,7 +394,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that calculates the square root of the associated number.
|
||||
* Creates new {@link AggregationExpression} that calculates the square root of the associated number.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -403,7 +403,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that subtracts value of given from the associated number.
|
||||
* Creates new {@link AggregationExpression} that subtracts value of given from the associated number.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
@@ -415,7 +415,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that subtracts value of given from the associated number.
|
||||
* Creates new {@link AggregationExpression} that subtracts value of given from the associated number.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
@@ -427,7 +427,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that subtracts value from the associated number.
|
||||
* Creates new {@link AggregationExpression} that subtracts value from the associated number.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
@@ -443,7 +443,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that truncates a number to its integer.
|
||||
* Creates new {@link AggregationExpression} that truncates a number to its integer.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -452,7 +452,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that calculates and returns the sum of numeric values.
|
||||
* Creates new {@link AggregationExpression} that calculates and returns the sum of numeric values.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -462,7 +462,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the average value of the numeric values.
|
||||
* Creates new {@link AggregationExpression} that returns the average value of the numeric values.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -472,7 +472,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the maximum value.
|
||||
* Creates new {@link AggregationExpression} that returns the maximum value.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -482,7 +482,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the minimum value.
|
||||
* Creates new {@link AggregationExpression} that returns the minimum value.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -492,7 +492,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that calculates the population standard deviation of the input values.
|
||||
* Creates new {@link AggregationExpression} that calculates the population standard deviation of the input values.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -502,7 +502,7 @@ public class ArithmeticOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that calculates the sample standard deviation of the input values.
|
||||
* Creates new {@link AggregationExpression} that calculates the sample standard deviation of the input values.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ArrayOperators {
|
||||
/**
|
||||
* Take the array referenced resulting from the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
public static ArrayOperatorFactory arrayOf(AggregationExpression expression) {
|
||||
@@ -88,7 +88,7 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated array and returns the element at the
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and returns the element at the
|
||||
* specified array {@literal position}.
|
||||
*
|
||||
* @param position
|
||||
@@ -99,8 +99,8 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated array and returns the element at the
|
||||
* position resulting form the given {@literal expression}.
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and returns the element at the position
|
||||
* resulting form the given {@literal expression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
@@ -112,8 +112,8 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated array and returns the element at the
|
||||
* position defined by the referenced {@literal field}.
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and returns the element at the position
|
||||
* defined by the referenced {@literal field}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
@@ -129,7 +129,7 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated array and concats the given
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and concats the given
|
||||
* {@literal arrayFieldReference} to it.
|
||||
*
|
||||
* @param arrayFieldReference must not be {@literal null}.
|
||||
@@ -142,7 +142,7 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated array and concats the array resulting form
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and concats the array resulting form
|
||||
* the given {@literal expression} to it.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -159,7 +159,7 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated array and selects a subset of the array to
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and selects a subset of the array to
|
||||
* return based on the specified condition.
|
||||
*
|
||||
* @return
|
||||
@@ -169,7 +169,7 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated array and an check if its an array.
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and an check if its an array.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -178,7 +178,7 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated array and retrieves its length.
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and retrieves its length.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -187,7 +187,7 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated array and selects a subset from it.
|
||||
* Creates new {@link AggregationExpression} that takes the associated array and selects a subset from it.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -196,7 +196,7 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that searches the associated array for an occurrence of a specified
|
||||
* Creates new {@link AggregationExpression} that searches the associated array for an occurrence of a specified
|
||||
* value and returns the array index (zero-based) of the first occurrence.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
@@ -208,7 +208,7 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns an array with the elements in reverse order.
|
||||
* Creates new {@link AggregationExpression} that returns an array with the elements in reverse order.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -217,8 +217,8 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Start creating new {@link AggregationExpressions} that applies an {@link AggregationExpression} to each element
|
||||
* in an array and combines them into a single value.
|
||||
* Start creating new {@link AggregationExpression} that applies an {@link AggregationExpression} to each element in
|
||||
* an array and combines them into a single value.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
@@ -235,8 +235,8 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Start creating new {@link AggregationExpressions} that applies an {@link AggregationExpression} to each element
|
||||
* in an array and combines them into a single value.
|
||||
* 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
|
||||
@@ -254,9 +254,9 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that transposes an array of input arrays so that the first element
|
||||
* of the output array would be an array containing, the first element of the first input array, the first element
|
||||
* of the second input array, etc.
|
||||
* Creates new {@link AggregationExpression} that transposes an array of input arrays so that the first element of
|
||||
* the output array would be an array containing, the first element of the first input array, the first element of
|
||||
* the second input array, etc.
|
||||
*
|
||||
* @param arrays must not be {@literal null}.
|
||||
* @return
|
||||
@@ -266,8 +266,8 @@ public class ArrayOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns a boolean indicating whether a specified value is in
|
||||
* the associated array.
|
||||
* Creates new {@link AggregationExpression} that returns a boolean indicating whether a specified value is in the
|
||||
* associated array.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
@@ -573,13 +573,18 @@ public class ArrayOperators {
|
||||
this.filter = new Filter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link InputBuilder}.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static InputBuilder newBuilder() {
|
||||
return new FilterExpressionBuilder();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Filter.InputBuilder#filter(java.util.List)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ArrayOperators.Filter.InputBuilder#filter(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
public AsBuilder filter(List<?> array) {
|
||||
@@ -591,7 +596,7 @@ public class ArrayOperators {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Filter.InputBuilder#filter(org.springframework.data.mongodb.core.aggregation.Field)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ArrayOperators.Filter.InputBuilder#filter(org.springframework.data.mongodb.core.aggregation.Field)
|
||||
*/
|
||||
@Override
|
||||
public AsBuilder filter(Field field) {
|
||||
@@ -603,7 +608,7 @@ public class ArrayOperators {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Filter.AsBuilder#as(java.lang.String)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ArrayOperators.Filter.AsBuilder#as(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public ConditionBuilder as(String variableName) {
|
||||
@@ -615,7 +620,7 @@ public class ArrayOperators {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Filter.ConditionBuilder#by(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ArrayOperators.Filter.ConditionBuilder#by(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
*/
|
||||
@Override
|
||||
public Filter by(AggregationExpression condition) {
|
||||
@@ -627,7 +632,7 @@ public class ArrayOperators {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Filter.ConditionBuilder#by(java.lang.String)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ArrayOperators.Filter.ConditionBuilder#by(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Filter by(String expression) {
|
||||
@@ -639,7 +644,7 @@ public class ArrayOperators {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Filter.ConditionBuilder#by(org.bson.Document)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ArrayOperators.Filter.ConditionBuilder#by(org.bson.Document)
|
||||
*/
|
||||
@Override
|
||||
public Filter by(Document expression) {
|
||||
@@ -1177,7 +1182,7 @@ public class ArrayOperators {
|
||||
* <b>NOTE:</b> During evaluation of the in expression the variable references {@link Variable#THIS} and
|
||||
* {@link Variable#VALUE} are available.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @param expressions must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
Reduce reduce(PropertyExpression... expressions);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class BooleanOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates the boolean value of the referenced field and returns the
|
||||
* Creates new {@link AggregationExpression} that evaluates the boolean value of the referenced field and returns the
|
||||
* opposite boolean value.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -62,7 +62,7 @@ public class BooleanOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates the boolean value of {@link AggregationExpression} result
|
||||
* Creates new {@link AggregationExpression} that evaluates the boolean value of {@link AggregationExpression} result
|
||||
* and returns the opposite boolean value.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -105,7 +105,7 @@ public class BooleanOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates one or more expressions and returns {@literal true} if
|
||||
* Creates new {@link AggregationExpression} that evaluates one or more expressions and returns {@literal true} if
|
||||
* all of the expressions are {@literal true}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -118,7 +118,7 @@ public class BooleanOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates one or more expressions and returns {@literal true} if
|
||||
* Creates new {@link AggregationExpression} that evaluates one or more expressions and returns {@literal true} if
|
||||
* all of the expressions are {@literal true}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -135,7 +135,7 @@ public class BooleanOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates one or more expressions and returns {@literal true} if
|
||||
* Creates new {@link AggregationExpression} that evaluates one or more expressions and returns {@literal true} if
|
||||
* any of the expressions are {@literal true}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -148,7 +148,7 @@ public class BooleanOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates one or more expressions and returns {@literal true} if
|
||||
* Creates new {@link AggregationExpression} that evaluates one or more expressions and returns {@literal true} if
|
||||
* any of the expressions are {@literal true}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
|
||||
@@ -78,7 +78,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values.
|
||||
* Creates new {@link AggregationExpression} that compares two values.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
* @return
|
||||
@@ -88,7 +88,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values.
|
||||
* Creates new {@link AggregationExpression} that compares two values.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
@@ -98,7 +98,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values.
|
||||
* Creates new {@link AggregationExpression} that compares two values.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
* @return
|
||||
@@ -112,7 +112,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is equal to the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -123,7 +123,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is equal to the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -134,7 +134,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is equal to the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
@@ -149,7 +149,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is greater than the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -160,7 +160,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is greater than the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -171,7 +171,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is greater than the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
@@ -186,7 +186,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is greater than or equivalent to the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -197,7 +197,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is greater than or equivalent to the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -208,7 +208,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is greater than or equivalent to the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
@@ -223,7 +223,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is less than the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -234,7 +234,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is less than the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -245,7 +245,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is less than to the given value.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
@@ -260,7 +260,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is less than or equivalent to the value of the referenced field.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -271,7 +271,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the first
|
||||
* value is less than or equivalent to the expression result.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -282,7 +282,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the first
|
||||
* 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
|
||||
@@ -297,7 +297,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the values
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the values
|
||||
* are not equivalent.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -308,7 +308,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the values
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the values
|
||||
* are not equivalent.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -319,7 +319,7 @@ public class ComparisonOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares two values and returns {@literal true} when the values
|
||||
* Creates new {@link AggregationExpression} that compares two values and returns {@literal true} when the values
|
||||
* are not equivalent.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.util.ClassUtils;
|
||||
* Gateway to {@literal conditional expressions} that evaluate their argument expressions as booleans to a value.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @since 1.10
|
||||
*/
|
||||
public class ConditionalOperators {
|
||||
|
||||
@@ -67,7 +68,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates an expression and returns the value of the expression if
|
||||
* Creates new {@link AggregationExpression} that evaluates an expression and returns the value of the expression if
|
||||
* the expression evaluates to a non-null value. If the expression evaluates to a {@literal null} value, including
|
||||
* instances of undefined values or missing fields, returns the value of the replacement expression.
|
||||
*
|
||||
@@ -81,7 +82,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates an expression and returns the value of the expression if
|
||||
* Creates new {@link AggregationExpression} that evaluates an expression and returns the value of the expression if
|
||||
* the expression evaluates to a non-null value. If the expression evaluates to a {@literal null} value, including
|
||||
* instances of undefined values or missing fields, returns the value of the replacement expression.
|
||||
*
|
||||
@@ -180,7 +181,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates a boolean expression to return one of the two specified
|
||||
* Creates new {@link AggregationExpression} that evaluates a boolean expression to return one of the two specified
|
||||
* return expressions.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -193,7 +194,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that evaluates a boolean expression to return one of the two specified
|
||||
* Creates new {@link AggregationExpression} that evaluates a boolean expression to return one of the two specified
|
||||
* return expressions.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -228,7 +229,8 @@ 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 http://docs.mongodb.com/manual/reference/operator/aggregation/ifNull/
|
||||
* @see <a href=
|
||||
* "http://docs.mongodb.com/manual/reference/operator/aggregation/ifNull/">http://docs.mongodb.com/manual/reference/operator/aggregation/ifNull/</a>
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public static class IfNull implements AggregationExpression {
|
||||
@@ -306,7 +308,7 @@ public class ConditionalOperators {
|
||||
/**
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public static interface IfNullBuilder {
|
||||
public interface IfNullBuilder {
|
||||
|
||||
/**
|
||||
* @param fieldReference the field to check for a {@literal null} value, field reference must not be
|
||||
@@ -326,7 +328,7 @@ public class ConditionalOperators {
|
||||
/**
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public static interface ThenBuilder {
|
||||
public interface ThenBuilder {
|
||||
|
||||
/**
|
||||
* @param value the value to be used if the {@code $ifNull} condition evaluates {@literal true}. Can be a
|
||||
@@ -346,11 +348,11 @@ public class ConditionalOperators {
|
||||
* @param expression the expression yielding to the replacement value, must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
public IfNull thenValueOf(AggregationExpression expression);
|
||||
IfNull thenValueOf(AggregationExpression expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for fluent {@link IfNullOperator} creation.
|
||||
* Builder for fluent {@link IfNull} creation.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@@ -361,7 +363,7 @@ public class ConditionalOperators {
|
||||
private IfNullOperatorBuilder() {}
|
||||
|
||||
/**
|
||||
* Creates a new builder for {@link IfNullOperator}.
|
||||
* Creates a new builder for {@link IfNull}.
|
||||
*
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
@@ -370,7 +372,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.IfNull.IfNullBuilder#ifNull(java.lang.String)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.IfNull.IfNullBuilder#ifNull(java.lang.String)
|
||||
*/
|
||||
public ThenBuilder ifNull(String fieldReference) {
|
||||
|
||||
@@ -380,7 +382,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.IfNull.IfNullBuilder#ifNull(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.IfNull.IfNullBuilder#ifNull(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
*/
|
||||
@Override
|
||||
public ThenBuilder ifNull(AggregationExpression expression) {
|
||||
@@ -391,14 +393,14 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.IfNull.ThenBuilder#then(java.lang.Object)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.IfNull.ThenBuilder#then(java.lang.Object)
|
||||
*/
|
||||
public IfNull then(Object value) {
|
||||
return new IfNull(condition, value);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.IfNull.ThenBuilder#thenValueOf(java.lang.String)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.IfNull.ThenBuilder#thenValueOf(java.lang.String)
|
||||
*/
|
||||
public IfNull thenValueOf(String fieldReference) {
|
||||
|
||||
@@ -407,7 +409,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.IfNull.ThenBuilder#thenValueOf(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.IfNull.ThenBuilder#thenValueOf(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
*/
|
||||
public IfNull thenValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -530,7 +532,8 @@ public class ConditionalOperators {
|
||||
* {@link AggregationExpression expressions}, values of simple MongoDB types or values that can be converted to a
|
||||
* simple MongoDB type.
|
||||
*
|
||||
* @see http://docs.mongodb.com/manual/reference/operator/aggregation/cond/
|
||||
* @see <a href=
|
||||
* "http://docs.mongodb.com/manual/reference/operator/aggregation/cond/">http://docs.mongodb.com/manual/reference/operator/aggregation/cond/</a>
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
@@ -761,7 +764,7 @@ public class ConditionalOperators {
|
||||
/**
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public static interface WhenBuilder {
|
||||
public interface WhenBuilder {
|
||||
|
||||
/**
|
||||
* @param booleanExpression expression that yields in a boolean result, must not be {@literal null}.
|
||||
@@ -791,7 +794,7 @@ public class ConditionalOperators {
|
||||
/**
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public static interface ThenBuilder {
|
||||
public interface ThenBuilder {
|
||||
|
||||
/**
|
||||
* @param value the value to be used if the condition evaluates {@literal true}. Can be a {@link Document}, a
|
||||
@@ -817,7 +820,7 @@ public class ConditionalOperators {
|
||||
/**
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public static interface OtherwiseBuilder {
|
||||
public interface OtherwiseBuilder {
|
||||
|
||||
/**
|
||||
* @param value the value to be used if the condition evaluates {@literal false}. Can be a {@link Document}, a
|
||||
@@ -862,7 +865,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.WhenBuilder#when(org.bson.Document)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.WhenBuilder#when(org.bson.Document)
|
||||
*/
|
||||
@Override
|
||||
public ConditionalExpressionBuilder when(Document booleanExpression) {
|
||||
@@ -874,7 +877,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.WhenBuilder#when(org.springframework.data.mongodb.core.query.CriteriaDefinition)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.WhenBuilder#when(org.springframework.data.mongodb.core.query.CriteriaDefinition)
|
||||
*/
|
||||
@Override
|
||||
public ThenBuilder when(CriteriaDefinition criteria) {
|
||||
@@ -885,7 +888,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.WhenBuilder#when(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.WhenBuilder#when(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
*/
|
||||
@Override
|
||||
public ThenBuilder when(AggregationExpression expression) {
|
||||
@@ -896,7 +899,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.WhenBuilder#when(java.lang.String)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.WhenBuilder#when(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public ThenBuilder when(String booleanField) {
|
||||
@@ -907,7 +910,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.ThenBuilder#then(java.lang.Object)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.ThenBuilder#then(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public OtherwiseBuilder then(Object thenValue) {
|
||||
@@ -918,7 +921,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.ThenBuilder#thenValueOf(java.lang.String)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.ThenBuilder#thenValueOf(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public OtherwiseBuilder thenValueOf(String fieldReference) {
|
||||
@@ -929,7 +932,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.ThenBuilder#thenValueOf(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.ThenBuilder#thenValueOf(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
*/
|
||||
@Override
|
||||
public OtherwiseBuilder thenValueOf(AggregationExpression expression) {
|
||||
@@ -940,7 +943,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.OtherwiseBuilder#otherwise(java.lang.Object)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.OtherwiseBuilder#otherwise(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Cond otherwise(Object otherwiseValue) {
|
||||
@@ -950,7 +953,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.OtherwiseBuilder#otherwiseValueOf(java.lang.String)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.OtherwiseBuilder#otherwiseValueOf(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Cond otherwiseValueOf(String fieldReference) {
|
||||
@@ -960,7 +963,7 @@ public class ConditionalOperators {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.AggregationExpressions.Cond.OtherwiseBuilder#otherwiseValueOf(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
* @see org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond.OtherwiseBuilder#otherwiseValueOf(org.springframework.data.mongodb.core.aggregation.AggregationExpression)
|
||||
*/
|
||||
@Override
|
||||
public Cond otherwiseValueOf(AggregationExpression expression) {
|
||||
|
||||
@@ -85,7 +85,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the day of the year for a date as a number between 1 and
|
||||
* Creates new {@link AggregationExpression} that returns the day of the year for a date as a number between 1 and
|
||||
* 366.
|
||||
*
|
||||
* @return
|
||||
@@ -95,7 +95,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the day of the month for a date as a number between 1 and
|
||||
* Creates new {@link AggregationExpression} that returns the day of the month for a date as a number between 1 and
|
||||
* 31.
|
||||
*
|
||||
* @return
|
||||
@@ -105,7 +105,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the day of the week for a date as a number between 1
|
||||
* Creates new {@link AggregationExpression} that returns the day of the week for a date as a number between 1
|
||||
* (Sunday) and 7 (Saturday).
|
||||
*
|
||||
* @return
|
||||
@@ -115,7 +115,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the year portion of a date.
|
||||
* Creates new {@link AggregationExpression} that returns the year portion of a date.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -124,7 +124,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the month of a date as a number between 1 and 12.
|
||||
* Creates new {@link AggregationExpression} that returns the month of a date as a number between 1 and 12.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -133,7 +133,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the week of the year for a date as a number between 0 and
|
||||
* Creates new {@link AggregationExpression} that returns the week of the year for a date as a number between 0 and
|
||||
* 53.
|
||||
*
|
||||
* @return
|
||||
@@ -143,7 +143,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the hour portion of a date as a number between 0 and 23.
|
||||
* Creates new {@link AggregationExpression} that returns the hour portion of a date as a number between 0 and 23.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -152,8 +152,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the minute portion of a date as a number between 0 and
|
||||
* 59.
|
||||
* Creates new {@link AggregationExpression} that returns the minute portion of a date as a number between 0 and 59.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -162,8 +161,8 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the second portion of a date as a number between 0 and
|
||||
* 59, but can be 60 to account for leap seconds.
|
||||
* 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
|
||||
*/
|
||||
@@ -172,7 +171,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the millisecond portion of a date as an integer between 0
|
||||
* Creates new {@link AggregationExpression} that returns the millisecond portion of a date as an integer between 0
|
||||
* and 999.
|
||||
*
|
||||
* @return
|
||||
@@ -182,7 +181,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that converts a date object to a string according to a user-specified
|
||||
* Creates new {@link AggregationExpression} that converts a date object to a string according to a user-specified
|
||||
* {@literal format}.
|
||||
*
|
||||
* @param format must not be {@literal null}.
|
||||
@@ -193,8 +192,8 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the weekday number in ISO 8601 format, ranging from 1
|
||||
* (for Monday) to 7 (for Sunday).
|
||||
* Creates new {@link AggregationExpression} that returns the weekday number in ISO 8601 format, ranging from 1 (for
|
||||
* Monday) to 7 (for Sunday).
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -203,7 +202,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the week number in ISO 8601 format, ranging from 1 to 53.
|
||||
* Creates new {@link AggregationExpression} that returns the week number in ISO 8601 format, ranging from 1 to 53.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -212,7 +211,7 @@ public class DateOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the year number in ISO 8601 format.
|
||||
* Creates new {@link AggregationExpression} that returns the year number in ISO 8601 format.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -56,7 +56,7 @@ public class LiteralOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that returns the associated value without parsing.
|
||||
* Creates new {@link Literal} that returns the associated value without parsing.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -83,7 +83,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares the previously mentioned field to one or more arrays and
|
||||
* Creates new {@link AggregationExpression} that compares the previously mentioned field to one or more arrays and
|
||||
* returns {@literal true} if they have the same distinct elements and {@literal false} otherwise.
|
||||
*
|
||||
* @param arrayReferences must not be {@literal null}.
|
||||
@@ -94,7 +94,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that compares the previously mentioned field to one or more arrays and
|
||||
* Creates new {@link AggregationExpression} that compares the previously mentioned field to one or more arrays and
|
||||
* returns {@literal true} if they have the same distinct elements and {@literal false} otherwise.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
@@ -109,7 +109,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes array of the previously mentioned field and one or more
|
||||
* Creates new {@link AggregationExpression} that takes array of the previously mentioned field and one or more
|
||||
* arrays and returns an array that contains the elements that appear in every of those.
|
||||
*
|
||||
* @param arrayReferences must not be {@literal null}.
|
||||
@@ -120,7 +120,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes array of the previously mentioned field and one or more
|
||||
* Creates new {@link AggregationExpression} that takes array of the previously mentioned field and one or more
|
||||
* arrays and returns an array that contains the elements that appear in every of those.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
@@ -135,7 +135,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes array of the previously mentioned field and one or more
|
||||
* Creates new {@link AggregationExpression} that takes array of the previously mentioned field and one or more
|
||||
* arrays and returns an array that contains the elements that appear in any of those.
|
||||
*
|
||||
* @param arrayReferences must not be {@literal null}.
|
||||
@@ -146,7 +146,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes array of the previously mentioned field and one or more
|
||||
* Creates new {@link AggregationExpression} that takes array of the previously mentioned field and one or more
|
||||
* arrays and returns an array that contains the elements that appear in any of those.
|
||||
*
|
||||
* @param expressions must not be {@literal null}.
|
||||
@@ -161,8 +161,8 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes array of the previously mentioned field and returns an
|
||||
* array containing the elements that do not exist in the given {@literal arrayReference}.
|
||||
* Creates new {@link AggregationExpression} that takes array of the previously mentioned field and returns an array
|
||||
* containing the elements that do not exist in the given {@literal arrayReference}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
* @return
|
||||
@@ -172,8 +172,8 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes array of the previously mentioned field and returns an
|
||||
* array containing the elements that do not exist in the given {@link AggregationExpression}.
|
||||
* Creates new {@link AggregationExpression} that takes array of the previously mentioned field and returns an array
|
||||
* containing the elements that do not exist in the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @return
|
||||
@@ -187,7 +187,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes array of the previously mentioned field and returns
|
||||
* Creates new {@link AggregationExpression} that takes array of the previously mentioned field and returns
|
||||
* {@literal true} if it is a subset of the given {@literal arrayReference}.
|
||||
*
|
||||
* @param arrayReference must not be {@literal null}.
|
||||
@@ -198,7 +198,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes array of the previously mentioned field and returns
|
||||
* Creates new {@link AggregationExpression} that takes array of the previously mentioned field and returns
|
||||
* {@literal true} if it is a subset of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -213,7 +213,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes array of the previously mentioned field and returns
|
||||
* 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
|
||||
@@ -223,7 +223,7 @@ public class SetOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that tkes array of the previously mentioned field and returns
|
||||
* Creates new {@link AggregationExpression} that tkes array of the previously mentioned field and returns
|
||||
* {@literal true} if no elements is {@literal false}.
|
||||
*
|
||||
* @return
|
||||
|
||||
@@ -84,7 +84,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and concats the value
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and concats the value
|
||||
* of the referenced field to it.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -97,7 +97,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and concats the result
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and concats the result
|
||||
* of the given {@link AggregationExpression} to it.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -110,7 +110,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and concats given
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and concats given
|
||||
* {@literal value} to it.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
@@ -127,8 +127,8 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and returns a
|
||||
* substring starting at a specified index position.
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and returns a substring
|
||||
* starting at a specified index position.
|
||||
*
|
||||
* @param start
|
||||
* @return
|
||||
@@ -138,8 +138,8 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and returns a
|
||||
* substring starting at a specified index position including the specified number of characters.
|
||||
* 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
|
||||
@@ -154,7 +154,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and lowers it.
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and lowers it.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -163,7 +163,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and uppers it.
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and uppers it.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -172,7 +172,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and performs
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and performs
|
||||
* case-insensitive comparison to the given {@literal value}.
|
||||
*
|
||||
* @param value must not be {@literal null}.
|
||||
@@ -185,7 +185,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and performs
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and performs
|
||||
* case-insensitive comparison to the referenced {@literal fieldReference}.
|
||||
*
|
||||
* @param fieldReference must not be {@literal null}.
|
||||
@@ -198,7 +198,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and performs
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and performs
|
||||
* case-insensitive comparison to the result of the given {@link AggregationExpression}.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
@@ -215,7 +215,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and searches a string
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and searches a string
|
||||
* for an occurrence of a given {@literal substring} and returns the UTF-8 byte index (zero-based) of the first
|
||||
* occurrence.
|
||||
*
|
||||
@@ -229,7 +229,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and searches a string
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and searches a string
|
||||
* for an occurrence of a substring contained in the given {@literal field reference} and returns the UTF-8 byte
|
||||
* index (zero-based) of the first occurrence.
|
||||
*
|
||||
@@ -243,7 +243,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and searches a string
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and searches a string
|
||||
* for an occurrence of a substring resulting from the given {@link AggregationExpression} and returns the UTF-8
|
||||
* byte index (zero-based) of the first occurrence.
|
||||
*
|
||||
@@ -261,7 +261,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and searches a string
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and searches a string
|
||||
* for an occurrence of a given {@literal substring} and returns the UTF-8 code point index (zero-based) of the
|
||||
* first occurrence.
|
||||
*
|
||||
@@ -275,7 +275,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and searches a string
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and searches a string
|
||||
* for an occurrence of a substring contained in the given {@literal field reference} and returns the UTF-8 code
|
||||
* point index (zero-based) of the first occurrence.
|
||||
*
|
||||
@@ -289,7 +289,7 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and searches a string
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and searches a string
|
||||
* for an occurrence of a substring resulting from the given {@link AggregationExpression} and returns the UTF-8
|
||||
* code point index (zero-based) of the first occurrence.
|
||||
*
|
||||
@@ -365,8 +365,8 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} that takes the associated string representation and returns a
|
||||
* substring starting at a specified code point index position.
|
||||
* Creates new {@link AggregationExpression} that takes the associated string representation and returns a substring
|
||||
* starting at a specified code point index position.
|
||||
*
|
||||
* @param codePointStart
|
||||
* @return
|
||||
@@ -376,8 +376,8 @@ public class StringOperators {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link AggregationExpressions} 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.
|
||||
* 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 nrOfCodePoints
|
||||
|
||||
@@ -127,7 +127,7 @@ public class VariableOperators {
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts building new {@link Map} that applies an {@link AggregationExpression} to each item of a referenced array
|
||||
|
||||
@@ -58,9 +58,9 @@ import org.springframework.data.mapping.model.MappingException;
|
||||
import org.springframework.data.mongodb.core.CollectionCallback;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.Venue;
|
||||
import org.springframework.data.mongodb.core.aggregation.VariableOperators.Let.ExpressionVariable;
|
||||
import org.springframework.data.mongodb.core.aggregation.AggregationTests.CarDescriptor.Entry;
|
||||
import org.springframework.data.mongodb.core.aggregation.BucketAutoOperation.Granularities;
|
||||
import org.springframework.data.mongodb.core.aggregation.VariableOperators.Let.ExpressionVariable;
|
||||
import org.springframework.data.mongodb.core.index.GeospatialIndex;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.NearQuery;
|
||||
@@ -1621,9 +1621,8 @@ public class AggregationTests {
|
||||
.as("finalTotal"));
|
||||
|
||||
AggregationResults<Document> result = mongoTemplate.aggregate(agg, Document.class);
|
||||
assertThat(result.getMappedResults(),
|
||||
contains(new Document("_id", "1").append("finalTotal", 9.450000000000001D),
|
||||
new Document("_id", "2").append("finalTotal", 10.25D)));
|
||||
assertThat(result.getMappedResults(), contains(new Document("_id", "1").append("finalTotal", 9.450000000000001D),
|
||||
new Document("_id", "2").append("finalTotal", 10.25D)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user