Package io.dialob.program.expr.arith
Class ImmutableConstant.Builder<T>
- java.lang.Object
-
- io.dialob.program.expr.arith.ImmutableConstant.Builder<T>
-
- Enclosing class:
- ImmutableConstant<T>
@NotThreadSafe public static final class ImmutableConstant.Builder<T> extends Object
Builds instances of typeImmutableConstant. 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 ImmutableConstant<T>build()Builds a newImmutableConstant.ImmutableConstant.Builder<T>from(Constant<T> instance)Fill a builder with attribute values from the providedio.dialob.program.expr.arith.Constantinstance.ImmutableConstant.Builder<T>from(Expression instance)Fill a builder with attribute values from the providedio.dialob.program.model.Expressioninstance.ImmutableConstant.Builder<T>value(T value)Initializes the value for thevalueattribute.ImmutableConstant.Builder<T>valueType(ValueType valueType)Initializes the value for thevalueTypeattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableConstant.Builder<T> from(Expression instance)
Fill a builder with attribute values from the providedio.dialob.program.model.Expressioninstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableConstant.Builder<T> from(Constant<T> instance)
Fill a builder with attribute values from the providedio.dialob.program.expr.arith.Constantinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
value
@CanIgnoreReturnValue public final ImmutableConstant.Builder<T> value(T value)
Initializes the value for thevalueattribute.- Parameters:
value- The value for value- Returns:
thisbuilder for use in a chained invocation
-
valueType
@CanIgnoreReturnValue public final ImmutableConstant.Builder<T> valueType(ValueType valueType)
Initializes the value for thevalueTypeattribute.- Parameters:
valueType- The value for valueType- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableConstant<T> build()
Builds a newImmutableConstant.- Returns:
- An immutable instance of Constant
- Throws:
IllegalStateException- if any required attributes are missing
-
-