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 Details

  • Constructor Details

  • Method Details

    • count

      public B count()
      Generates a builder for a $sum-expression.
      Count expressions are emulated via $sum: 1.
      Returns:
      never null.
    • sum

      public B sum()
      Generates a builder for a $sum-expression for the current value.
      Returns:
      never null.
    • sum

      public B sum(Number value)
      Generates a builder for a $sum-expression for the given value.
      Parameters:
      value - must not be null.
      Returns:
      never null.
    • last

      public B last()
      Generates a builder for an $last-expression for the current value..
      Returns:
      never null.
    • first

      public B first()
      Generates a builder for a $first-expression the current value.
      Returns:
      never null.
    • avg

      public B avg()
      Generates a builder for an $avg-expression for the current value.
      Returns:
      never null.
    • min

      public B min()
      Generates a builder for an $min-expression for the current value.
      Returns:
      never null.
    • max

      public B max()
      Generates a builder for an $max-expression for the current value.
      Returns:
      never null.
    • push

      public B push()
      Generates a builder for an $push-expression for the current value.
      Returns:
      never null.
    • addToSet

      public B addToSet()
      Generates a builder for an $addToSet-expression for the current value.
      Returns:
      never null.
    • apply

      public B apply(String operation, Object... values)
      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

      protected abstract B apply(BucketOperationSupport.OperationOutput operationOutput)
      Parameters:
      operationOutput - must not be null.
      Returns:
      never null.
    • as

      public T as(String alias)
      Returns the finally to be applied BucketOperation with the given alias.
      Parameters:
      alias - will never be null or empty.
      Returns:
      never null.