Package io.dialob.program.expr.arith
Class ImmutableBinaryOperator.Builder<T>
- java.lang.Object
-
- io.dialob.program.expr.arith.ImmutableBinaryOperator.Builder<T>
-
- Enclosing class:
- ImmutableBinaryOperator<T>
@NotThreadSafe public static final class ImmutableBinaryOperator.Builder<T> extends Object
Builds instances of typeImmutableBinaryOperator. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableBinaryOperator.Builder<T>addAllNodes(Iterable<? extends Expression> elements)Adds elements tonodeslist.ImmutableBinaryOperator.Builder<T>addNodes(Expression element)Adds one element tonodeslist.ImmutableBinaryOperator.Builder<T>addNodes(Expression... elements)Adds elements tonodeslist.ImmutableBinaryOperator<T>build()Builds a newImmutableBinaryOperator.ImmutableBinaryOperator.Builder<T>from(BinaryOperator<T> instance)Fill a builder with attribute values from the providedBinaryOperatorinstance.ImmutableBinaryOperator.Builder<T>nodes(Iterable<? extends Expression> elements)Sets or replaces all elements fornodeslist.ImmutableBinaryOperator.Builder<T>reducer(Reducer<T> reducer)Initializes the value for thereducerattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableBinaryOperator.Builder<T> from(BinaryOperator<T> instance)
Fill a builder with attribute values from the providedBinaryOperatorinstance. 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
-
addNodes
@CanIgnoreReturnValue public final ImmutableBinaryOperator.Builder<T> addNodes(Expression element)
Adds one element tonodeslist.- Parameters:
element- A nodes element- Returns:
thisbuilder for use in a chained invocation
-
addNodes
@CanIgnoreReturnValue public final ImmutableBinaryOperator.Builder<T> addNodes(Expression... elements)
Adds elements tonodeslist.- Parameters:
elements- An array of nodes elements- Returns:
thisbuilder for use in a chained invocation
-
nodes
@CanIgnoreReturnValue public final ImmutableBinaryOperator.Builder<T> nodes(Iterable<? extends Expression> elements)
Sets or replaces all elements fornodeslist.- Parameters:
elements- An iterable of nodes elements- Returns:
thisbuilder for use in a chained invocation
-
addAllNodes
@CanIgnoreReturnValue public final ImmutableBinaryOperator.Builder<T> addAllNodes(Iterable<? extends Expression> elements)
Adds elements tonodeslist.- Parameters:
elements- An iterable of nodes elements- Returns:
thisbuilder for use in a chained invocation
-
reducer
@CanIgnoreReturnValue public final ImmutableBinaryOperator.Builder<T> reducer(Reducer<T> reducer)
Initializes the value for thereducerattribute.- Parameters:
reducer- The value for reducer- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableBinaryOperator<T> build()
Builds a newImmutableBinaryOperator.- Returns:
- An immutable instance of BinaryOperator
- Throws:
IllegalStateException- if any required attributes are missing
-
-