Class ImmutableUpdateValueSetCommand

java.lang.Object
io.dialob.session.engine.session.command.ImmutableUpdateValueSetCommand
All Implemented Interfaces:
Command<ValueSetState>, UpdateCommand<ValueSetId,ValueSetState>, UpdateValueSetCommand, Serializable

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

Use the builder to create immutable instances: ImmutableUpdateValueSetCommand.builder(). Use the static factory method to create immutable instances: ImmutableUpdateValueSetCommand.of().

See Also:
  • Method Details

    • getTriggers

      public com.google.common.collect.ImmutableList<Trigger<ValueSetState>> getTriggers()
      Specified by:
      getTriggers in interface Command<ValueSetState>
      Returns:
      The value of the triggers attribute
    • getTargetId

      public ValueSetId getTargetId()
      Specified by:
      getTargetId in interface UpdateCommand<ValueSetId,ValueSetState>
      Returns:
      The value of the targetId attribute
    • getEntries

      public com.google.common.collect.ImmutableList<Value<ValueSet.Entry>> getEntries()
      Specified by:
      getEntries in interface UpdateValueSetCommand
      Returns:
      The value of the entries attribute
    • withTriggers

      @SafeVarargs public final ImmutableUpdateValueSetCommand withTriggers(Trigger<ValueSetState>... elements)
      Copy the current immutable object with elements that replace the content of triggers.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withTriggers

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

      public final ImmutableUpdateValueSetCommand withTargetId(ValueSetId value)
      Copy the current immutable object by setting a value for the targetId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Specified by:
      withTargetId in interface UpdateCommand<ValueSetId,ValueSetState>
      Parameters:
      value - A new value for targetId
      Returns:
      A modified copy or the this object
    • withEntries

      @SafeVarargs public final ImmutableUpdateValueSetCommand withEntries(Value<ValueSet.Entry>... elements)
      Copy the current immutable object with elements that replace the content of entries.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withEntries

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableUpdateValueSetCommand 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: triggers, targetId, entries.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableUpdateValueSetCommand of(ValueSetId targetId, List<Value<ValueSet.Entry>> entries, List<Trigger<ValueSetState>> triggers)
      Construct a new immutable UpdateValueSetCommand instance.
      Parameters:
      targetId - The value for the targetId attribute
      entries - The value for the entries attribute
      triggers - The value for the triggers attribute
      Returns:
      An immutable UpdateValueSetCommand instance
    • of

      public static ImmutableUpdateValueSetCommand of(ValueSetId targetId, Iterable<? extends Value<ValueSet.Entry>> entries, Iterable<? extends Trigger<ValueSetState>> triggers)
      Construct a new immutable UpdateValueSetCommand instance.
      Parameters:
      targetId - The value for the targetId attribute
      entries - The value for the entries attribute
      triggers - The value for the triggers attribute
      Returns:
      An immutable UpdateValueSetCommand instance
    • copyOf

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

      public static ImmutableUpdateValueSetCommand.Builder builder()
      Creates a builder for ImmutableUpdateValueSetCommand.
       ImmutableUpdateValueSetCommand.builder()
          .addTriggers|addAllTriggers(io.dialob.session.engine.session.command.Trigger<io.dialob.session.engine.session.model.ValueSetState>) // triggers elements
          .targetId(io.dialob.session.engine.session.model.ValueSetId) // required targetId
          .addEntries|addAllEntries(io.dialob.session.engine.program.model.Value<io.dialob.session.engine.program.model.ValueSet.Entry>) // entries elements
          .build();
       
      Returns:
      A new ImmutableUpdateValueSetCommand builder