Class ImmutableGroup

java.lang.Object
io.dialob.session.engine.program.model.ImmutableGroup
All Implemented Interfaces:
DisplayItem, Group, Item, ProgramNode, StructuralNode, Serializable

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

Use the builder to create immutable instances: ImmutableGroup.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
    • getValueType

      @Nullable public ValueType getValueType()
      Specified by:
      getValueType in interface Item
      Returns:
      The value of the valueType 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
    • getView

      @Nullable public String getView()
      Specified by:
      getView in interface DisplayItem
      Returns:
      The value of the view attribute
    • getProps

      @Nullable public Map<String,Object> getProps()
      Specified by:
      getProps in interface DisplayItem
      Returns:
      The value of the props attribute
    • getClassName

      public Optional<Expression> getClassName()
      Specified by:
      getClassName in interface DisplayItem
      Returns:
      The value of the className attribute
    • getActiveExpression

      public Optional<Expression> getActiveExpression()
      Specified by:
      getActiveExpression in interface DisplayItem
      Returns:
      The value of the activeExpression attribute
    • getRequiredExpression

      public Optional<Expression> getRequiredExpression()
      Specified by:
      getRequiredExpression in interface DisplayItem
      Returns:
      The value of the requiredExpression attribute
    • getDisabledExpression

      public Optional<Expression> getDisabledExpression()
      Specified by:
      getDisabledExpression in interface DisplayItem
      Returns:
      The value of the disabledExpression attribute
    • getLabelExpression

      public Optional<Expression> getLabelExpression()
      Specified by:
      getLabelExpression in interface DisplayItem
      Returns:
      The value of the labelExpression attribute
    • getDescriptionExpression

      public Optional<Expression> getDescriptionExpression()
      Specified by:
      getDescriptionExpression in interface DisplayItem
      Returns:
      The value of the descriptionExpression attribute
    • getErrors

      public List<Error> getErrors()
      Specified by:
      getErrors in interface DisplayItem
      Returns:
      The value of the errors attribute
    • getItemsExpression

      public Expression getItemsExpression()
      Specified by:
      getItemsExpression in interface Group
      Returns:
      The value of the itemsExpression attribute
    • getAvailableItemsExpression

      public Optional<Expression> getAvailableItemsExpression()
      Specified by:
      getAvailableItemsExpression in interface Group
      Returns:
      The value of the availableItemsExpression attribute
    • getIsInvalidAnswersExpression

      public Optional<Expression> getIsInvalidAnswersExpression()
      Specified by:
      getIsInvalidAnswersExpression in interface Group
      Returns:
      The value of the isInvalidAnswersExpression attribute
    • getAllowedActionsExpression

      public Optional<Expression> getAllowedActionsExpression()
      Specified by:
      getAllowedActionsExpression in interface Group
      Returns:
      The value of the allowedActionsExpression attribute
    • getCanAddRowWhenExpression

      public Optional<Expression> getCanAddRowWhenExpression()
      Specified by:
      getCanAddRowWhenExpression in interface Group
      Returns:
      The value of the canAddRowWhenExpression attribute
    • getCanRemoveRowWhenExpression

      public Optional<Expression> getCanRemoveRowWhenExpression()
      Specified by:
      getCanRemoveRowWhenExpression in interface Group
      Returns:
      The value of the canRemoveRowWhenExpression attribute
    • withIsPrototype

      public final ImmutableGroup 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 ImmutableGroup 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 ImmutableGroup 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
    • withValueType

      public final ImmutableGroup withValueType(@Nullable ValueType value)
      Copy the current immutable object by setting a value for the valueType attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for valueType (can be null)
      Returns:
      A modified copy or the this object
    • withValueSetId

      public final ImmutableGroup 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 ImmutableGroup 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 ImmutableGroup 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 ImmutableGroup 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
    • withView

      public final ImmutableGroup withView(@Nullable String value)
      Copy the current immutable object by setting a value for the view attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for view (can be null)
      Returns:
      A modified copy or the this object
    • withProps

      public final ImmutableGroup withProps(@Nullable Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the props map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to replace the props map
      Returns:
      A modified copy or this if not changed
    • withClassName

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

      public final ImmutableGroup withClassName(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the className 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 className
      Returns:
      A modified copy or this if not changed
    • withActiveExpression

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

      public final ImmutableGroup withActiveExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the activeExpression 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 activeExpression
      Returns:
      A modified copy or this if not changed
    • withRequiredExpression

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

      public final ImmutableGroup withRequiredExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the requiredExpression 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 requiredExpression
      Returns:
      A modified copy or this if not changed
    • withDisabledExpression

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

      public final ImmutableGroup withDisabledExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the disabledExpression 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 disabledExpression
      Returns:
      A modified copy or this if not changed
    • withLabelExpression

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

      public final ImmutableGroup withLabelExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the labelExpression 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 labelExpression
      Returns:
      A modified copy or this if not changed
    • withDescriptionExpression

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

      public final ImmutableGroup withDescriptionExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the descriptionExpression 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 descriptionExpression
      Returns:
      A modified copy or this if not changed
    • withErrors

      public final ImmutableGroup withErrors(Error... elements)
      Copy the current immutable object with elements that replace the content of errors.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withErrors

      public final ImmutableGroup withErrors(Iterable<? extends Error> elements)
      Copy the current immutable object with elements that replace the content of errors. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of errors elements to set
      Returns:
      A modified copy or this if not changed
    • withItemsExpression

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

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

      public final ImmutableGroup withAvailableItemsExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the availableItemsExpression 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 availableItemsExpression
      Returns:
      A modified copy or this if not changed
    • withIsInvalidAnswersExpression

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

      public final ImmutableGroup withIsInvalidAnswersExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the isInvalidAnswersExpression 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 isInvalidAnswersExpression
      Returns:
      A modified copy or this if not changed
    • withAllowedActionsExpression

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

      public final ImmutableGroup withAllowedActionsExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the allowedActionsExpression 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 allowedActionsExpression
      Returns:
      A modified copy or this if not changed
    • withCanAddRowWhenExpression

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

      public final ImmutableGroup withCanAddRowWhenExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the canAddRowWhenExpression 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 canAddRowWhenExpression
      Returns:
      A modified copy or this if not changed
    • withCanRemoveRowWhenExpression

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

      public final ImmutableGroup withCanRemoveRowWhenExpression(Optional<? extends Expression> optional)
      Copy the current immutable object by setting an optional value for the canRemoveRowWhenExpression 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 canRemoveRowWhenExpression
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableGroup 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, valueType, valueSetId, defaultValue, view, props, className, activeExpression, requiredExpression, disabledExpression, labelExpression, descriptionExpression, errors, itemsExpression, availableItemsExpression, isInvalidAnswersExpression, allowedActionsExpression, canAddRowWhenExpression, canRemoveRowWhenExpression.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableGroup copyOf(Group instance)
      Creates an immutable copy of a Group 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 Group instance
    • builder

      public static ImmutableGroup.Builder builder()
      Creates a builder for ImmutableGroup.
       ImmutableGroup.builder()
          .isPrototype(boolean) // optional isPrototype
          .id(io.dialob.session.engine.session.model.ItemId) // required id
          .type(String) // required type
          .valueType(io.dialob.rule.parser.api.ValueType | null) // nullable valueType
          .valueSetId(Optional<String>) // optional valueSetId
          .defaultValue(Optional<Object>) // optional defaultValue
          .view(String | null) // nullable view
          .props(Map<String, Object> | null) // nullable props
          .className(Optional<io.dialob.session.engine.program.model.Expression>) // optional className
          .activeExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional activeExpression
          .requiredExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional requiredExpression
          .disabledExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional disabledExpression
          .labelExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional labelExpression
          .descriptionExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional descriptionExpression
          .addErrors|addAllErrors(io.dialob.session.engine.program.model.Error) // errors elements
          .itemsExpression(io.dialob.session.engine.program.model.Expression) // required itemsExpression
          .availableItemsExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional availableItemsExpression
          .isInvalidAnswersExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional isInvalidAnswersExpression
          .allowedActionsExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional allowedActionsExpression
          .canAddRowWhenExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional canAddRowWhenExpression
          .canRemoveRowWhenExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional canRemoveRowWhenExpression
          .build();
       
      Returns:
      A new ImmutableGroup builder