Class SetWindowFieldsOperation.SetWindowFieldsOperationBuilder
java.lang.Object
org.springframework.data.mongodb.core.aggregation.SetWindowFieldsOperation.SetWindowFieldsOperationBuilder
- Enclosing class:
SetWindowFieldsOperation
A fluent builder to create a
SetWindowFieldsOperation.- Since:
- 3.3
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface to capture field name used to capture the computation result.static interfaceInterface to capture an optionalSetWindowFieldsOperation.Windowapplicable to the field computation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Obtain a new instance ofSetWindowFieldsOperationwith previously set arguments.output(AggregationExpression expression) Add a field capturing the result of the givenexpressionto the output.Define the actual output computation.partitionBy(Object value) Partition by a value that translates to a valid mongodb expression.partitionByExpression(AggregationExpression expression) Specify theexpressionto group by.partitionByField(String fieldName) Specify the field to group by.Sortascendingby the given fields.Set the sort order.sortBy(SortOperation sort) Set theSortOperationto use.
-
Constructor Details
-
SetWindowFieldsOperationBuilder
public SetWindowFieldsOperationBuilder()
-
-
Method Details
-
partitionByField
@Contract("_ -> this") public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder partitionByField(String fieldName) Specify the field to group by.- Parameters:
fieldName- must not be null or null.- Returns:
- this.
-
partitionByExpression
@Contract("_ -> this") public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder partitionByExpression(AggregationExpression expression) Specify theexpressionto group by.- Parameters:
expression- must not be null.- Returns:
- this.
-
sortBy
@Contract("_ -> this") public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder sortBy(String... fields) Sortascendingby the given fields.- Parameters:
fields- must not be null.- Returns:
- this.
-
sortBy
@Contract("_ -> this") public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder sortBy(Sort sort) Set the sort order.- Parameters:
sort- must not be null.- Returns:
- this.
-
sortBy
@Contract("_ -> this") public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder sortBy(SortOperation sort) Set theSortOperationto use.- Parameters:
sort- must not be null.- Returns:
- this.
-
output
@Contract("_ -> this") public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder output(SetWindowFieldsOperation.WindowOutput output) Define the actual output computation.- Parameters:
output- must not be null.- Returns:
- this.
-
output
@Contract("_ -> new") public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder.WindowChoice output(AggregationExpression expression) Add a field capturing the result of the givenexpressionto the output.- Parameters:
expression- must not be null.- Returns:
- new instance of
SetWindowFieldsOperation.SetWindowFieldsOperationBuilder.WindowChoice.
-
partitionBy
@Contract("_ -> this") public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder partitionBy(Object value) Partition by a value that translates to a valid mongodb expression.- Parameters:
value- must not be null.- Returns:
- this.
-
build
Obtain a new instance ofSetWindowFieldsOperationwith previously set arguments.- Returns:
- new instance of
SetWindowFieldsOperation.
-