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 ofVariable.Use the builder to create immutable instances:
ImmutableVariable.builder(). Use the static factory method to create immutable instances:ImmutableVariable.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableVariable.BuilderBuilds instances of typeImmutableVariable.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableVariable.Builderbuilder()Creates a builder forImmutableVariable.static ImmutableVariablecopyOf(Variable instance)Creates an immutable copy of aVariablevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableVariablethat have equal attribute values.BooleangetContext()StringgetContextType()ObjectgetDefaultValue()StringgetExpression()StringgetName()BooleangetPublished()inthashCode()Computes a hash code from attributes:name,expression,defaultValue,context,published,contextType.static ImmutableVariableof(String name, String expression)Construct a new immutableVariableinstance.StringtoString()Prints the immutable valueVariablewith attribute values.ImmutableVariablewithContext(Boolean value)Copy the current immutable object by setting a value for thecontextattribute.ImmutableVariablewithContextType(String value)Copy the current immutable object by setting a value for thecontextTypeattribute.ImmutableVariablewithDefaultValue(Object value)Copy the current immutable object by setting a value for thedefaultValueattribute.ImmutableVariablewithExpression(String value)Copy the current immutable object by setting a value for theexpressionattribute.ImmutableVariablewithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableVariablewithPublished(Boolean value)Copy the current immutable object by setting a value for thepublishedattribute.
-
-
-
Method Detail
-
getName
public String getName()
-
getExpression
public String getExpression()
- Specified by:
getExpressionin interfaceVariable- Returns:
- The value of the
expressionattribute
-
getDefaultValue
public Object getDefaultValue()
- Specified by:
getDefaultValuein interfaceVariable- Returns:
- The value of the
defaultValueattribute
-
getContext
public Boolean getContext()
- Specified by:
getContextin interfaceVariable- Returns:
- true when this is context variable
-
getPublished
public Boolean getPublished()
- Specified by:
getPublishedin interfaceVariable- Returns:
- true when context variable can be published and sent to client.
-
getContextType
public String getContextType()
- Specified by:
getContextTypein interfaceVariable- Returns:
- The value of the
contextTypeattribute
-
withName
public final ImmutableVariable withName(String value)
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
public final ImmutableVariable withExpression(String value)
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
public final ImmutableVariable withDefaultValue(Object value)
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
public final ImmutableVariable withContext(Boolean value)
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
public final ImmutableVariable withPublished(Boolean value)
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
public final ImmutableVariable withContextType(String value)
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
public boolean equals(@Nullable Object another)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
public String toString()
Prints the immutable valueVariablewith attribute values.
-
of
public static ImmutableVariable of(String name, String expression)
Construct a new immutableVariableinstance.- Parameters:
name- The value for thenameattributeexpression- The value for theexpressionattribute- Returns:
- An immutable Variable instance
-
copyOf
public static ImmutableVariable copyOf(Variable instance)
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
public static ImmutableVariable.Builder 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
-
-