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