Interface BiAction<T>

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface BiAction<T>
A function that is executed when an interaction occurs in a gui. Takes an additional parameter as the input.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    act(Window window, T input)
    Executes the bi-action.
    static <T> BiAction<T>
    compose(BiAction<T>... actions)
    Returns a bi-action composed of multiple bi-actions.
    static <T> BiAction<T>
    compose(List<BiAction<T>> actions)
    Returns a bi-action composed of multiple bi-actions.
    static <T> BiAction<T>
    Returns a bi-action using the result of the given delegate to run another action.
    static <T> BiAction<T>
    from(Action action)
    Returns a BiAction that wraps the given Action.
    default BiAction<T>
    then(Action next)
    Returns a BiAction that executes this bi-action and then the given action.
    default BiAction<T>
    then(BiAction<T> next)
    Returns a BiAction that executes this bi-action and then the given bi-action.
    static <T> BiAction<T>
    with(Key<T> key)
    Returns a bi-action that sets a state entry with the bi-action input.
  • Method Details

    • from

      static <T> BiAction<T> from(Action action)
      Returns a BiAction that wraps the given Action.
      Parameters:
      action - the action
      Returns:
      the bi-action
    • with

      static <T> BiAction<T> with(Key<T> key)
      Returns a bi-action that sets a state entry with the bi-action input.
      Type Parameters:
      T - the type of the value
      Parameters:
      key - the key
      Returns:
      the bi-action
    • delegate

      static <T> BiAction<T> delegate(BiFunction<Window,T,Action> delegate)
      Returns a bi-action using the result of the given delegate to run another action.
      Parameters:
      delegate - the delegate
      Returns:
      the bi-action
    • compose

      @SafeVarargs static <T> BiAction<T> compose(BiAction<T>... actions)
      Returns a bi-action composed of multiple bi-actions.
      Parameters:
      actions - the bi-actions
      Returns:
      the bi-action
    • compose

      static <T> BiAction<T> compose(List<BiAction<T>> actions)
      Returns a bi-action composed of multiple bi-actions.
      Parameters:
      actions - the bi-actions
      Returns:
      the bi-action
    • act

      void act(Window window, T input)
      Executes the bi-action.
      Parameters:
      window - the window
      input - the input
    • then

      default BiAction<T> then(BiAction<T> next)
      Returns a BiAction that executes this bi-action and then the given bi-action.
      Parameters:
      next - the next bi-action
      Returns:
      the bi-action
    • then

      default BiAction<T> then(Action next)
      Returns a BiAction that executes this bi-action and then the given action.
      Parameters:
      next - the next action
      Returns:
      the bi-action