Package io.dialob.program.expr.arith
Class ImmutableArrayReducerOperator<T>
- java.lang.Object
-
- io.dialob.program.expr.arith.ImmutableArrayReducerOperator<T>
-
- All Implemented Interfaces:
ArrayReducerOperator<T>,Expression,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableArrayReducerOperator<T> extends Object implements ArrayReducerOperator<T>
Immutable implementation ofArrayReducerOperator.Use the builder to create immutable instances:
ImmutableArrayReducerOperator.builder(). Use the static factory method to create immutable instances:ImmutableArrayReducerOperator.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableArrayReducerOperator.Builder<T>Builds instances of typeImmutableArrayReducerOperator.
-
Field Summary
-
Fields inherited from interface io.dialob.program.expr.arith.ArrayReducerOperator
ALL, ANSWER_COUNT, ANY, DECIMAL_MAX, DECIMAL_MIN, DECIMAL_SUM, INTEGER_MAX, INTEGER_MIN, INTEGER_SUM
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ImmutableArrayReducerOperator.Builder<T>builder()Creates a builder forImmutableArrayReducerOperator.static <T> ImmutableArrayReducerOperator<T>copyOf(ArrayReducerOperator<T> instance)Creates an immutable copy of aArrayReducerOperatorvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableArrayReducerOperatorthat have equal attribute values.ExpressiongetArrayExpression()@Nullable ObjectgetPlaceholderValue()BinaryOperator<T>getReducer()inthashCode()Computes a hash code from attributes:reducer,arrayExpression,placeholderValue.static <T> ImmutableArrayReducerOperator<T>of(BinaryOperator<T> reducer, Expression arrayExpression)Construct a new immutableArrayReducerOperatorinstance.StringtoString()Prints the immutable valueArrayReducerOperatorwith attribute values.ImmutableArrayReducerOperator<T>withArrayExpression(Expression value)Copy the current immutable object by setting a value for thearrayExpressionattribute.ImmutableArrayReducerOperator<T>withPlaceholderValue(@Nullable Object value)Copy the current immutable object by setting a value for theplaceholderValueattribute.ImmutableArrayReducerOperator<T>withReducer(BinaryOperator<T> value)Copy the current immutable object by setting a value for thereducerattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.dialob.program.expr.arith.ArrayReducerOperator
eval, getEvalRequiredConditions, getValueType
-
-
-
-
Method Detail
-
getReducer
public BinaryOperator<T> getReducer()
- Specified by:
getReducerin interfaceArrayReducerOperator<T>- Returns:
- The value of the
reducerattribute
-
getArrayExpression
public Expression getArrayExpression()
- Specified by:
getArrayExpressionin interfaceArrayReducerOperator<T>- Returns:
- The value of the
arrayExpressionattribute
-
getPlaceholderValue
@Nullable public @Nullable Object getPlaceholderValue()
- Specified by:
getPlaceholderValuein interfaceArrayReducerOperator<T>- Returns:
- The value of the
placeholderValueattribute
-
withReducer
public final ImmutableArrayReducerOperator<T> withReducer(BinaryOperator<T> value)
Copy the current immutable object by setting a value for thereducerattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for reducer- Returns:
- A modified copy of the
thisobject
-
withArrayExpression
public final ImmutableArrayReducerOperator<T> withArrayExpression(Expression value)
Copy the current immutable object by setting a value for thearrayExpressionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for arrayExpression- Returns:
- A modified copy of the
thisobject
-
withPlaceholderValue
public final ImmutableArrayReducerOperator<T> withPlaceholderValue(@Nullable @Nullable Object value)
Copy the current immutable object by setting a value for theplaceholderValueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for placeholderValue (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableArrayReducerOperatorthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:reducer,arrayExpression,placeholderValue.
-
toString
public String toString()
Prints the immutable valueArrayReducerOperatorwith attribute values.
-
of
public static <T> ImmutableArrayReducerOperator<T> of(BinaryOperator<T> reducer, Expression arrayExpression)
Construct a new immutableArrayReducerOperatorinstance.- Type Parameters:
T- generic parameter T- Parameters:
reducer- The value for thereducerattributearrayExpression- The value for thearrayExpressionattribute- Returns:
- An immutable ArrayReducerOperator instance
-
copyOf
public static <T> ImmutableArrayReducerOperator<T> copyOf(ArrayReducerOperator<T> instance)
Creates an immutable copy of aArrayReducerOperatorvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
T- generic parameter T- Parameters:
instance- The instance to copy- Returns:
- A copied immutable ArrayReducerOperator instance
-
builder
public static <T> ImmutableArrayReducerOperator.Builder<T> builder()
Creates a builder forImmutableArrayReducerOperator.ImmutableArrayReducerOperator.<T>builder() .reducer(function.BinaryOperator<T>) // requiredreducer.arrayExpression(io.dialob.program.model.Expression) // requiredarrayExpression.placeholderValue(Object | null) // nullableplaceholderValue.build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableArrayReducerOperator builder
-
-