Package io.substrait.relation
Class ImmutableMeasure
java.lang.Object
io.substrait.relation.Aggregate.Measure
io.substrait.relation.ImmutableMeasure
Immutable implementation of
Aggregate.Measure.
Use the builder to create immutable instances:
ImmutableMeasure.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableMeasure.Builderbuilder()Creates a builder forImmutableMeasure.static ImmutableMeasurecopyOf(Aggregate.Measure instance) Creates an immutable copy of aAggregate.Measurevalue.booleanThis instance is equal to all instances ofImmutableMeasurethat have equal attribute values.inthashCode()Computes a hash code from attributes:function,preMeasureFilter.toString()Prints the immutable valueMeasurewith attribute values.final ImmutableMeasureCopy the current immutable object by setting a value for thefunctionattribute.final ImmutableMeasurewithPreMeasureFilter(Expression value) Copy the current immutable object by setting a present value for the optionalpreMeasureFilterattribute.final ImmutableMeasurewithPreMeasureFilter(Optional<? extends Expression> optional) Copy the current immutable object by setting an optional value for thepreMeasureFilterattribute.
-
Method Details
-
getFunction
- Specified by:
getFunctionin classAggregate.Measure- Returns:
- The value of the
functionattribute
-
getPreMeasureFilter
- Specified by:
getPreMeasureFilterin classAggregate.Measure- Returns:
- The value of the
preMeasureFilterattribute
-
withFunction
Copy the current immutable object by setting a value for thefunctionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for function- Returns:
- A modified copy or the
thisobject
-
withPreMeasureFilter
Copy the current immutable object by setting a present value for the optionalpreMeasureFilterattribute.- Parameters:
value- The value for preMeasureFilter- Returns:
- A modified copy or
thisif not changed
-
withPreMeasureFilter
Copy the current immutable object by setting an optional value for thepreMeasureFilterattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for preMeasureFilter- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableMeasurethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:function,preMeasureFilter. -
toString
Prints the immutable valueMeasurewith attribute values. -
copyOf
Creates an immutable copy of aAggregate.Measurevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Measure instance
-
builder
Creates a builder forImmutableMeasure.ImmutableMeasure.builder() .function(io.substrait.expression.AggregateFunctionInvocation) // requiredfunction.preMeasureFilter(Optional<io.substrait.expression.Expression>) // optionalpreMeasureFilter.build();- Returns:
- A new ImmutableMeasure builder
-