Class ImmutableVariableItem

java.lang.Object
io.dialob.session.engine.program.model.ImmutableVariableItem
All Implemented Interfaces:
Item, ProgramNode, StructuralNode, VariableItem, Serializable

@Generated(from="VariableItem", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableVariableItem extends Object implements VariableItem
Immutable implementation of VariableItem.

Use the builder to create immutable instances: ImmutableVariableItem.builder().

See Also:
  • Method Details

    • isPrototype

      public boolean isPrototype()
      Specified by:
      isPrototype in interface StructuralNode
      Returns:
      The value of the isPrototype attribute
    • getId

      public ItemId getId()
      Specified by:
      getId in interface Item
      Returns:
      The value of the id attribute
    • getType

      public String getType()
      Specified by:
      getType in interface Item
      Returns:
      The value of the type attribute
    • getValueSetId

      public Optional<String> getValueSetId()
      Specified by:
      getValueSetId in interface Item
      Returns:
      The value of the valueSetId attribute
    • getDefaultValue

      public Optional<Object> getDefaultValue()
      Specified by:
      getDefaultValue in interface Item
      Returns:
      The value of the defaultValue attribute
    • getValueExpression

      public Expression getValueExpression()
      Specified by:
      getValueExpression in interface VariableItem
      Returns:
      The value of the valueExpression attribute
    • isAsync

      public boolean isAsync()
      Specified by:
      isAsync in interface VariableItem
      Returns:
      The value of the isAsync attribute
    • isPublished

      public boolean isPublished()
      Specified by:
      isPublished in interface VariableItem
      Returns:
      The value of the isPublished attribute
    • withIsPrototype

      public final ImmutableVariableItem withIsPrototype(boolean value)
      Copy the current immutable object by setting a value for the isPrototype attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isPrototype
      Returns:
      A modified copy or the this object
    • withId

      public final ImmutableVariableItem withId(ItemId value)
      Copy the current immutable object by setting a value for the id attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for id
      Returns:
      A modified copy or the this object
    • withType

      public final ImmutableVariableItem withType(String value)
      Copy the current immutable object by setting a value for the type attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type
      Returns:
      A modified copy or the this object
    • withValueSetId

      public final ImmutableVariableItem withValueSetId(String value)
      Copy the current immutable object by setting a present value for the optional valueSetId attribute.
      Parameters:
      value - The value for valueSetId
      Returns:
      A modified copy or this if not changed
    • withValueSetId

      public final ImmutableVariableItem withValueSetId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the valueSetId attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for valueSetId
      Returns:
      A modified copy or this if not changed
    • withDefaultValue

      public final ImmutableVariableItem withDefaultValue(Object value)
      Copy the current immutable object by setting a present value for the optional defaultValue attribute.
      Parameters:
      value - The value for defaultValue
      Returns:
      A modified copy or this if not changed
    • withDefaultValue

      public final ImmutableVariableItem withDefaultValue(Optional<? extends Object> optional)
      Copy the current immutable object by setting an optional value for the defaultValue attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for defaultValue
      Returns:
      A modified copy or this if not changed
    • withValueExpression

      public final ImmutableVariableItem withValueExpression(Expression value)
      Copy the current immutable object by setting a value for the valueExpression attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for valueExpression
      Returns:
      A modified copy or the this object
    • withIsAsync

      public final ImmutableVariableItem withIsAsync(boolean value)
      Copy the current immutable object by setting a value for the isAsync attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isAsync
      Returns:
      A modified copy or the this object
    • withIsPublished

      public final ImmutableVariableItem withIsPublished(boolean value)
      Copy the current immutable object by setting a value for the isPublished attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isPublished
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableVariableItem that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: isPrototype, id, type, valueSetId, defaultValue, valueExpression, isAsync, isPublished.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value VariableItem with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableVariableItem copyOf(VariableItem instance)
      Creates an immutable copy of a VariableItem value. 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 VariableItem instance
    • builder

      public static ImmutableVariableItem.Builder builder()
      Creates a builder for ImmutableVariableItem.
       ImmutableVariableItem.builder()
          .isPrototype(boolean) // optional isPrototype
          .id(io.dialob.session.engine.session.model.ItemId) // required id
          .type(String) // required type
          .valueSetId(Optional<String>) // optional valueSetId
          .defaultValue(Optional<Object>) // optional defaultValue
          .valueExpression(io.dialob.session.engine.program.model.Expression) // required valueExpression
          .isAsync(boolean) // optional isAsync
          .isPublished(boolean) // optional isPublished
          .build();
       
      Returns:
      A new ImmutableVariableItem builder