Module spring.data.mongodb
Class BucketOperationSupport.OutputBuilder<B extends BucketOperationSupport.OutputBuilder<B,T>,T extends BucketOperationSupport<T,B>>
java.lang.Object
org.springframework.data.mongodb.core.aggregation.BucketOperationSupport.OutputBuilder<B,T>
- Direct Known Subclasses:
BucketAutoOperation.BucketAutoOperationOutputBuilder,BucketOperation.BucketOperationOutputBuilder,BucketOperationSupport.ExpressionBucketOperationBuilderSupport
- Enclosing class:
- BucketOperationSupport<T extends BucketOperationSupport<T,
B>, B extends BucketOperationSupport.OutputBuilder<B, T>>
public abstract static class BucketOperationSupport.OutputBuilder<B extends BucketOperationSupport.OutputBuilder<B,T>,T extends BucketOperationSupport<T,B>>
extends Object
Base class for
BucketOperationSupport.Output builders that result in a BucketOperationSupport providing the built
BucketOperationSupport.Output.- Author:
- Mark Paluch
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOutputBuilder(Object value, T operation) Creates a newBucketOperationSupport.OutputBuilderfor the given value andBucketOperationSupport. -
Method Summary
Modifier and TypeMethodDescriptionaddToSet()Generates a builder for an$addToSet-expression for the current value.Apply an operator to the current value.protected abstract Bapply(BucketOperationSupport.OperationOutput operationOutput) Apply anBucketOperationSupport.OperationOutputto this output.Returns the finally to be appliedBucketOperationwith the given alias.avg()Generates a builder for an$avg-expression for the current value.count()Generates a builder for a$sum-expression.first()Generates a builder for a$first-expression the current value.last()Generates a builder for an$last-expression for the current value..max()Generates a builder for an$max-expression for the current value.min()Generates a builder for an$min-expression for the current value.push()Generates a builder for an$push-expression for the current value.sum()Generates a builder for a$sum-expression for the current value.Generates a builder for a$sum-expression for the given value.
-
Field Details
-
value
-
operation
-
-
Constructor Details
-
OutputBuilder
Creates a newBucketOperationSupport.OutputBuilderfor the given value andBucketOperationSupport.- Parameters:
value- must not be null.operation- must not be null.
-
-
Method Details
-
count
Generates a builder for a$sum-expression.
Count expressions are emulated via$sum: 1.- Returns:
- never null.
-
sum
Generates a builder for a$sum-expression for the current value.- Returns:
- never null.
-
sum
Generates a builder for a$sum-expression for the given value.- Parameters:
value- must not be null.- Returns:
- never null.
-
last
Generates a builder for an$last-expression for the current value..- Returns:
- never null.
-
first
Generates a builder for a$first-expression the current value.- Returns:
- never null.
-
avg
Generates a builder for an$avg-expression for the current value.- Returns:
- never null.
-
min
Generates a builder for an$min-expression for the current value.- Returns:
- never null.
-
max
Generates a builder for an$max-expression for the current value.- Returns:
- never null.
-
push
Generates a builder for an$push-expression for the current value.- Returns:
- never null.
-
addToSet
Generates a builder for an$addToSet-expression for the current value.- Returns:
- never null.
-
apply
Apply an operator to the current value.- Parameters:
operation- the operation name, must not be null or empty.values- must not be null.- Returns:
- never null.
-
apply
Apply anBucketOperationSupport.OperationOutputto this output.- Parameters:
operationOutput- must not be null.- Returns:
- never null.
-
as
Returns the finally to be appliedBucketOperationwith the given alias.- Parameters:
alias- will never be null or empty.- Returns:
- never null.
-