Package io.dialob.api.form
Class ImmutableVariable
java.lang.Object
io.dialob.api.form.ImmutableVariable
- All Implemented Interfaces:
Variable,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableVariable
extends Object
implements Variable
Immutable implementation of
Variable.
Use the builder to create immutable instances:
ImmutableVariable.builder().
Use the static factory method to create immutable instances:
ImmutableVariable.of().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableVariable.Builderbuilder()Creates a builder forImmutableVariable.static ImmutableVariableCreates an immutable copy of aVariablevalue.booleanThis instance is equal to all instances ofImmutableVariablethat have equal attribute values.getName()inthashCode()Computes a hash code from attributes:name,expression,defaultValue,context,published,contextType.static ImmutableVariableConstruct a new immutableVariableinstance.toString()Prints the immutable valueVariablewith attribute values.final ImmutableVariablewithContext(Boolean value) Copy the current immutable object by setting a value for thecontextattribute.final ImmutableVariablewithContextType(String value) Copy the current immutable object by setting a value for thecontextTypeattribute.final ImmutableVariablewithDefaultValue(Object value) Copy the current immutable object by setting a value for thedefaultValueattribute.final ImmutableVariablewithExpression(String value) Copy the current immutable object by setting a value for theexpressionattribute.final ImmutableVariableCopy the current immutable object by setting a value for thenameattribute.final ImmutableVariablewithPublished(Boolean value) Copy the current immutable object by setting a value for thepublishedattribute.
-
Method Details
-
getName
-
getExpression
- Specified by:
getExpressionin interfaceVariable- Returns:
- The value of the
expressionattribute
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceVariable- Returns:
- The value of the
defaultValueattribute
-
getContext
- Specified by:
getContextin interfaceVariable- Returns:
- true when this is context variable
-
getPublished
- Specified by:
getPublishedin interfaceVariable- Returns:
- true when context variable can be published and sent to client.
-
getContextType
- Specified by:
getContextTypein interfaceVariable- Returns:
- The value of the
contextTypeattribute
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name (can benull)- Returns:
- A modified copy of the
thisobject
-
withExpression
Copy the current immutable object by setting a value for theexpressionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for expression (can benull)- Returns:
- A modified copy of the
thisobject
-
withDefaultValue
Copy the current immutable object by setting a value for thedefaultValueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for defaultValue (can benull)- Returns:
- A modified copy of the
thisobject
-
withContext
Copy the current immutable object by setting a value for thecontextattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for context (can benull)- Returns:
- A modified copy of the
thisobject
-
withPublished
Copy the current immutable object by setting a value for thepublishedattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for published (can benull)- Returns:
- A modified copy of the
thisobject
-
withContextType
Copy the current immutable object by setting a value for thecontextTypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for contextType (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableVariablethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,expression,defaultValue,context,published,contextType. -
toString
Prints the immutable valueVariablewith attribute values. -
of
Construct a new immutableVariableinstance.- Parameters:
name- The value for thenameattributeexpression- The value for theexpressionattribute- Returns:
- An immutable Variable instance
-
copyOf
Creates an immutable copy of aVariablevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Variable instance
-
builder
Creates a builder forImmutableVariable.ImmutableVariable.builder() .name(String | null) // nullablename.expression(String | null) // nullableexpression.defaultValue(Object | null) // nullabledefaultValue.context(Boolean | null) // nullablecontext.published(Boolean | null) // nullablepublished.contextType(String | null) // nullablecontextType.build();- Returns:
- A new ImmutableVariable builder
-