Class ImmutableComplete

java.lang.Object
io.dialob.session.engine.session.command.ImmutableComplete
All Implemented Interfaces:
AbstractUpdateCommand<ItemId,ItemState>, Command<ItemState>, Complete, ItemUpdateCommand, UpdateCommand<ItemId,ItemState>, Serializable

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

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

See Also:
  • Method Details

    • getTriggers

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

      public ItemId getTargetId()
      Specified by:
      getTargetId in interface Complete
      Specified by:
      getTargetId in interface UpdateCommand<ItemId,ItemState>
      Returns:
      The value of the targetId attribute
    • withTriggers

      @SafeVarargs public final ImmutableComplete withTriggers(Trigger<ItemState>... 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 ImmutableComplete withTriggers(Iterable<? extends Trigger<ItemState>> 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 ImmutableComplete withTargetId(ItemId 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<ItemId,ItemState>
      Parameters:
      value - A new value for targetId
      Returns:
      A modified copy or the this object
    • equals

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

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

      public static ImmutableComplete of(List<Trigger<ItemState>> triggers)
      Construct a new immutable Complete instance.
      Parameters:
      triggers - The value for the triggers attribute
      Returns:
      An immutable Complete instance
    • of

      public static ImmutableComplete of(Iterable<? extends Trigger<ItemState>> triggers)
      Construct a new immutable Complete instance.
      Parameters:
      triggers - The value for the triggers attribute
      Returns:
      An immutable Complete instance
    • copyOf

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

      public static ImmutableComplete.Builder builder()
      Creates a builder for ImmutableComplete.
       ImmutableComplete.builder()
          .addTriggers|addAllTriggers(io.dialob.session.engine.session.command.Trigger<io.dialob.session.engine.session.model.ItemState>) // triggers elements
          .targetId(io.dialob.session.engine.session.model.ItemId) // optional targetId
          .build();
       
      Returns:
      A new ImmutableComplete builder