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