Class ImmutableGotoPage

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

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

Use the builder to create immutable instances: ImmutableGotoPage.builder(). Use the static factory method to create immutable instances: ImmutableGotoPage.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 UpdateCommand<ItemId,ItemState>
      Returns:
      The value of the targetId attribute
    • getPage

      public ItemId getPage()
      Specified by:
      getPage in interface GotoPage
      Returns:
      The value of the page attribute
    • withTriggers

      @SafeVarargs public final ImmutableGotoPage 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 ImmutableGotoPage 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 ImmutableGotoPage 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
    • withPage

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

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

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

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

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

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

      public static ImmutableGotoPage.Builder builder()
      Creates a builder for ImmutableGotoPage.
       ImmutableGotoPage.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
          .page(io.dialob.session.engine.session.model.ItemId) // required page
          .build();
       
      Returns:
      A new ImmutableGotoPage builder
    • pageIsInactive

      default boolean pageIsInactive(EvalContext context, ItemId page)
    • anyErrors

      default boolean anyErrors(EvalContext context)
    • gotoPage

      default ItemState gotoPage(EvalContext context, ItemState itemState, ItemId page)