Package io.substrait.expression
Class ImmutableAggregateFunctionInvocation.Builder
java.lang.Object
io.substrait.expression.ImmutableAggregateFunctionInvocation.Builder
- Enclosing class:
- ImmutableAggregateFunctionInvocation
Builds instances of type
ImmutableAggregateFunctionInvocation.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllArguments(Iterable<? extends FunctionArg> elements) Adds elements toargumentslist.addAllOptions(Iterable<? extends FunctionOption> elements) Adds elements tooptionslist.addAllSort(Iterable<? extends Expression.SortField> elements) Adds elements tosortlist.addArguments(FunctionArg element) Adds one element toargumentslist.addArguments(FunctionArg... elements) Adds elements toargumentslist.addOptions(FunctionOption element) Adds one element tooptionslist.addOptions(FunctionOption... elements) Adds elements tooptionslist.addSort(Expression.SortField element) Adds one element tosortlist.addSort(Expression.SortField... elements) Adds elements tosortlist.aggregationPhase(Expression.AggregationPhase aggregationPhase) Initializes the value for theaggregationPhaseattribute.arguments(Iterable<? extends FunctionArg> elements) Sets or replaces all elements forargumentslist.build()Builds a newImmutableAggregateFunctionInvocation.declaration(SimpleExtension.AggregateFunctionVariant declaration) Initializes the value for thedeclarationattribute.from(AggregateFunctionInvocation instance) Fill a builder with attribute values from the providedAggregateFunctionInvocationinstance.invocation(Expression.AggregationInvocation invocation) Initializes the value for theinvocationattribute.options(Iterable<? extends FunctionOption> elements) Sets or replaces all elements foroptionslist.outputType(Type outputType) Initializes the value for theoutputTypeattribute.sort(Iterable<? extends Expression.SortField> elements) Sets or replaces all elements forsortlist.
-
Method Details
-
from
public final ImmutableAggregateFunctionInvocation.Builder from(AggregateFunctionInvocation instance) Fill a builder with attribute values from the providedAggregateFunctionInvocationinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
declaration
public final ImmutableAggregateFunctionInvocation.Builder declaration(SimpleExtension.AggregateFunctionVariant declaration) Initializes the value for thedeclarationattribute.- Parameters:
declaration- The value for declaration- Returns:
thisbuilder for use in a chained invocation
-
addArguments
Adds one element toargumentslist.- Parameters:
element- A arguments element- Returns:
thisbuilder for use in a chained invocation
-
addArguments
Adds elements toargumentslist.- Parameters:
elements- An array of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
arguments
public final ImmutableAggregateFunctionInvocation.Builder arguments(Iterable<? extends FunctionArg> elements) Sets or replaces all elements forargumentslist.- Parameters:
elements- An iterable of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
addAllArguments
public final ImmutableAggregateFunctionInvocation.Builder addAllArguments(Iterable<? extends FunctionArg> elements) Adds elements toargumentslist.- Parameters:
elements- An iterable of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
addOptions
Adds one element tooptionslist.- Parameters:
element- A options element- Returns:
thisbuilder for use in a chained invocation
-
addOptions
Adds elements tooptionslist.- Parameters:
elements- An array of options elements- Returns:
thisbuilder for use in a chained invocation
-
options
public final ImmutableAggregateFunctionInvocation.Builder options(Iterable<? extends FunctionOption> elements) Sets or replaces all elements foroptionslist.- Parameters:
elements- An iterable of options elements- Returns:
thisbuilder for use in a chained invocation
-
addAllOptions
public final ImmutableAggregateFunctionInvocation.Builder addAllOptions(Iterable<? extends FunctionOption> elements) Adds elements tooptionslist.- Parameters:
elements- An iterable of options elements- Returns:
thisbuilder for use in a chained invocation
-
aggregationPhase
public final ImmutableAggregateFunctionInvocation.Builder aggregationPhase(Expression.AggregationPhase aggregationPhase) Initializes the value for theaggregationPhaseattribute.- Parameters:
aggregationPhase- The value for aggregationPhase- Returns:
thisbuilder for use in a chained invocation
-
addSort
Adds one element tosortlist.- Parameters:
element- A sort element- Returns:
thisbuilder for use in a chained invocation
-
addSort
Adds elements tosortlist.- Parameters:
elements- An array of sort elements- Returns:
thisbuilder for use in a chained invocation
-
sort
public final ImmutableAggregateFunctionInvocation.Builder sort(Iterable<? extends Expression.SortField> elements) Sets or replaces all elements forsortlist.- Parameters:
elements- An iterable of sort elements- Returns:
thisbuilder for use in a chained invocation
-
addAllSort
public final ImmutableAggregateFunctionInvocation.Builder addAllSort(Iterable<? extends Expression.SortField> elements) Adds elements tosortlist.- Parameters:
elements- An iterable of sort elements- Returns:
thisbuilder for use in a chained invocation
-
outputType
Initializes the value for theoutputTypeattribute.- Parameters:
outputType- The value for outputType- Returns:
thisbuilder for use in a chained invocation
-
invocation
public final ImmutableAggregateFunctionInvocation.Builder invocation(Expression.AggregationInvocation invocation) Initializes the value for theinvocationattribute.- Parameters:
invocation- The value for invocation- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableAggregateFunctionInvocation.- Returns:
- An immutable instance of AggregateFunctionInvocation
- Throws:
IllegalStateException- if any required attributes are missing
-