Package io.substrait.relation
Class ImmutableMeasure.Builder
java.lang.Object
io.substrait.relation.ImmutableMeasure.Builder
- Enclosing class:
- ImmutableMeasure
Builds instances of type
ImmutableMeasure.
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 TypeMethodDescriptionbuild()Builds a newImmutableMeasure.final ImmutableMeasure.Builderfrom(Aggregate.Measure instance) Fill a builder with attribute values from the providedMeasureinstance.final ImmutableMeasure.Builderfunction(AggregateFunctionInvocation function) Initializes the value for thefunctionattribute.final ImmutableMeasure.BuilderpreMeasureFilter(Expression preMeasureFilter) Initializes the optional valuepreMeasureFilterto preMeasureFilter.final ImmutableMeasure.BuilderpreMeasureFilter(Optional<? extends Expression> preMeasureFilter) Initializes the optional valuepreMeasureFilterto preMeasureFilter.
-
Method Details
-
from
Fill a builder with attribute values from the providedMeasureinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
function
Initializes the value for thefunctionattribute.- Parameters:
function- The value for function- Returns:
thisbuilder for use in a chained invocation
-
preMeasureFilter
Initializes the optional valuepreMeasureFilterto preMeasureFilter.- Parameters:
preMeasureFilter- The value for preMeasureFilter- Returns:
thisbuilder for chained invocation
-
preMeasureFilter
public final ImmutableMeasure.Builder preMeasureFilter(Optional<? extends Expression> preMeasureFilter) Initializes the optional valuepreMeasureFilterto preMeasureFilter.- Parameters:
preMeasureFilter- The value for preMeasureFilter- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableMeasure.- Returns:
- An immutable instance of Measure
- Throws:
IllegalStateException- if any required attributes are missing
-