Class ImmutableStaticTrigger<T>

java.lang.Object
io.dialob.session.engine.session.command.ImmutableStaticTrigger<T>
All Implemented Interfaces:
StaticTrigger<T>, Trigger<T>, Serializable

@Generated(from="StaticTrigger", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableStaticTrigger<T> extends Object implements StaticTrigger<T>
Immutable implementation of StaticTrigger.

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

See Also:
  • Method Details

    • getWhen

      public BiPredicate<T,T> getWhen()
      Specified by:
      getWhen in interface Trigger<T>
      Returns:
      The value of the when attribute
    • getAllEvents

      public com.google.common.collect.ImmutableList<Event> getAllEvents()
      Specified by:
      getAllEvents in interface Trigger<T>
      Returns:
      The value of the allEvents attribute
    • withWhen

      public final ImmutableStaticTrigger<T> withWhen(BiPredicate<T,T> value)
      Copy the current immutable object by setting a value for the when attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for when
      Returns:
      A modified copy or the this object
    • withAllEvents

      public final ImmutableStaticTrigger<T> withAllEvents(Event... elements)
      Copy the current immutable object with elements that replace the content of allEvents.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAllEvents

      public final ImmutableStaticTrigger<T> withAllEvents(Iterable<? extends Event> elements)
      Copy the current immutable object with elements that replace the content of allEvents. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of allEvents 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 ImmutableStaticTrigger 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: when, allEvents.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static <T> ImmutableStaticTrigger<T> of(BiPredicate<T,T> when)
      Construct a new immutable StaticTrigger instance.
      Type Parameters:
      T - generic parameter T
      Parameters:
      when - The value for the when attribute
      Returns:
      An immutable StaticTrigger instance
    • copyOf

      public static <T> ImmutableStaticTrigger<T> copyOf(StaticTrigger<T> instance)
      Creates an immutable copy of a StaticTrigger value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      T - generic parameter T
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable StaticTrigger instance
    • builder

      public static <T> ImmutableStaticTrigger.Builder<T> builder()
      Creates a builder for ImmutableStaticTrigger.
       ImmutableStaticTrigger.<T>builder()
          .when(function.BiPredicate<T, T>) // required when
          .addAllEvents|addAllAllEvents(io.dialob.session.engine.session.command.event.Event) // allEvents elements
          .build();
       
      Type Parameters:
      T - generic parameter T
      Returns:
      A new ImmutableStaticTrigger builder