diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java index 1fbc641b0..66f4d1789 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java @@ -28,7 +28,7 @@ import org.springframework.util.Assert; public class ConvertOperators { /** - * Take the value referenced by given {@literal fieldReference}. + * Take the field referenced by given {@literal fieldReference}. * * @param fieldReference must not be {@literal null}. * @return @@ -38,7 +38,7 @@ public class ConvertOperators { } /** - * Take the value provided by the given {@link AggregationExpression}. + * Take the value resulting from the given {@link AggregationExpression}. * * @param expression must not be {@literal null}. * @return @@ -63,6 +63,7 @@ public class ConvertOperators { public ConvertOperatorFactory(String fieldReference) { Assert.notNull(fieldReference, "FieldReference must not be null!"); + this.fieldReference = fieldReference; this.expression = null; } @@ -75,13 +76,14 @@ public class ConvertOperators { public ConvertOperatorFactory(AggregationExpression expression) { Assert.notNull(expression, "Expression must not be null!"); + this.fieldReference = null; this.expression = expression; } /** * Creates new {@link Convert aggregation expression} that takes the associated value and converts it into the type - * specified by the given identifier.
+ * specified by the given {@code stringTypeIdentifier}.
* NOTE: Requires MongoDB 4.0 or later. * * @param stringTypeIdentifier must not be {@literal null}. @@ -93,7 +95,7 @@ public class ConvertOperators { /** * Creates new {@link Convert aggregation expression} that takes the associated value and converts it into the type - * specified by the given identifier.
+ * specified by the given {@code numericTypeIdentifier}.
* NOTE: Requires MongoDB 4.0 or later. * * @param numericTypeIdentifier must not be {@literal null}. @@ -410,13 +412,13 @@ public class ConvertOperators { } /** - * {@link AggregationExpression} for {@code $toBool} that converts a value to boolean. Shorthand for + * {@link AggregationExpression} for {@code $toBool} that converts a value to {@literal boolean}. Shorthand for * {@link Convert#to(String) Convert#to("bool")}.
* NOTE: Requires MongoDB 4.0 or later. * * @author Christoph Strobl * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toBool/ + * "https://docs.mongodb.com/manual/reference/operator/aggregation/toBool/">https://docs.mongodb.com/manual/reference/operator/aggregation/toBool/ * @since 1.10.15 */ public static class ToBool extends AbstractAggregationExpression { @@ -442,7 +444,7 @@ public class ConvertOperators { } /** - * {@link AggregationExpression} for {@code $toDate} that converts a value to boolean. Shorthand for + * {@link AggregationExpression} for {@code $toDate} that converts a value to {@literal date}. Shorthand for * {@link Convert#to(String) Convert#to("date")}.
* NOTE: Requires MongoDB 4.0 or later. * @@ -474,7 +476,7 @@ public class ConvertOperators { } /** - * {@link AggregationExpression} for {@code $toDecimal} that converts a value to decimal. Shorthand for + * {@link AggregationExpression} for {@code $toDecimal} that converts a value to {@literal decimal}. Shorthand for * {@link Convert#to(String) Convert#to("decimal")}.
* NOTE: Requires MongoDB 4.0 or later. * @@ -506,7 +508,7 @@ public class ConvertOperators { } /** - * {@link AggregationExpression} for {@code $toDouble} that converts a value to double. Shorthand for + * {@link AggregationExpression} for {@code $toDouble} that converts a value to {@literal double}. Shorthand for * {@link Convert#to(String) Convert#to("double")}.
* NOTE: Requires MongoDB 4.0 or later. * @@ -538,7 +540,7 @@ public class ConvertOperators { } /** - * {@link AggregationExpression} for {@code $toInt} that converts a value to integer. Shorthand for + * {@link AggregationExpression} for {@code $toInt} that converts a value to {@literal integer}. Shorthand for * {@link Convert#to(String) Convert#to("int")}.
* NOTE: Requires MongoDB 4.0 or later. * @@ -570,7 +572,7 @@ public class ConvertOperators { } /** - * {@link AggregationExpression} for {@code $toLong} that converts a value to long. Shorthand for + * {@link AggregationExpression} for {@code $toLong} that converts a value to {@literal long}. Shorthand for * {@link Convert#to(String) Convert#to("long")}.
* NOTE: Requires MongoDB 4.0 or later. * @@ -602,7 +604,7 @@ public class ConvertOperators { } /** - * {@link AggregationExpression} for {@code $toObjectId} that converts a value to objectId. Shorthand for + * {@link AggregationExpression} for {@code $toObjectId} that converts a value to {@literal objectId}. Shorthand for * {@link Convert#to(String) Convert#to("objectId")}.
* NOTE: Requires MongoDB 4.0 or later. * @@ -634,7 +636,7 @@ public class ConvertOperators { } /** - * {@link AggregationExpression} for {@code $toString} that converts a value to string. Shorthand for + * {@link AggregationExpression} for {@code $toString} that converts a value to {@literal string}. Shorthand for * {@link Convert#to(String) Convert#to("string")}.
* NOTE: Requires MongoDB 4.0 or later. *