Package io.dialob.api.form
Class ImmutableVariable.Builder
- java.lang.Object
-
- io.dialob.api.form.ImmutableVariable.Builder
-
- Enclosing class:
- ImmutableVariable
@NotThreadSafe public static final class ImmutableVariable.Builder extends Object
Builds instances of typeImmutableVariable. 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 ImmutableVariablebuild()Builds a newImmutableVariable.ImmutableVariable.Buildercontext(Boolean context)Initializes the value for thecontextattribute.ImmutableVariable.BuildercontextType(String contextType)Initializes the value for thecontextTypeattribute.ImmutableVariable.BuilderdefaultValue(Object defaultValue)Initializes the value for thedefaultValueattribute.ImmutableVariable.Builderexpression(String expression)Initializes the value for theexpressionattribute.ImmutableVariable.Builderfrom(ModifiableVariable instance)Fill a builder with attribute values from the providedModifiableVariableinstance.ImmutableVariable.Builderfrom(Variable instance)Fill a builder with attribute values from the providedVariableinstance.ImmutableVariable.Buildername(String name)Initializes the value for thenameattribute.ImmutableVariable.Builderpublished(Boolean published)Initializes the value for thepublishedattribute.
-
-
-
Method Detail
-
from
public final ImmutableVariable.Builder from(ModifiableVariable instance)
Fill a builder with attribute values from the providedModifiableVariableinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
public final ImmutableVariable.Builder from(Variable instance)
Fill a builder with attribute values from the providedVariableinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
name
public final ImmutableVariable.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name (can benull)- Returns:
thisbuilder for use in a chained invocation
-
expression
public final ImmutableVariable.Builder expression(String expression)
Initializes the value for theexpressionattribute.- Parameters:
expression- The value for expression (can benull)- Returns:
thisbuilder for use in a chained invocation
-
defaultValue
public final ImmutableVariable.Builder defaultValue(Object defaultValue)
Initializes the value for thedefaultValueattribute.- Parameters:
defaultValue- The value for defaultValue (can benull)- Returns:
thisbuilder for use in a chained invocation
-
context
public final ImmutableVariable.Builder context(Boolean context)
Initializes the value for thecontextattribute.- Parameters:
context- The value for context (can benull)- Returns:
thisbuilder for use in a chained invocation
-
published
public final ImmutableVariable.Builder published(Boolean published)
Initializes the value for thepublishedattribute.- Parameters:
published- The value for published (can benull)- Returns:
thisbuilder for use in a chained invocation
-
contextType
public final ImmutableVariable.Builder contextType(String contextType)
Initializes the value for thecontextTypeattribute.- Parameters:
contextType- The value for contextType (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableVariable build()
Builds a newImmutableVariable.- Returns:
- An immutable instance of Variable
- Throws:
IllegalStateException- if any required attributes are missing
-
-