JavaScript is disabled on your browser.
Skip navigation links
  • Summary:
  • Nested |
  • Field |
  • Constr |
  • Method
  • Detail:
  • Field |
  • Constr |
  • Method
org.codefx.libfx.concurrent.when

Class ExecuteWhen<T>

  • Type Parameters:
    T - the type the ObservableValue which will be observed by the constructed instance wraps


    public class ExecuteWhen<T>
    extends Object 

    Builder for ExecuteAlwaysWhen and ExecuteOnceWhen.

    Example

    A typical use would look like this:
     ObservableValue<State> workerState;
     ExecuteWhen.on(workerState)
     .when(state -> state == State.SUCCEEDED)
     .thenOnce(state -> logSuccess())
     .executeWhen();
     
    • Method Detail

      • on

        public static <T> ExecuteWhen<T> on(javafx.beans.value.ObservableValue<T> observable)
        Creates a new builder. The built instance of Execute...When will observe the specified observable.
        Type Parameters:
        T - the type the ObservableValue which will be observed by the constructed instance wraps
        Parameters:
        observable - the ObservableValue which will be observed by the created Execute...When instances
        Returns:
        a new builder instance
      • when

        public ExecuteWhen<T> when(Predicate<? super T> condition)
        Specifies the condition the observable's value must fulfill in order for the action to be executed.
        Parameters:
        condition - the condition as a Predicate
        Returns:
        this builder
Skip navigation links
  • Summary:
  • Nested |
  • Field |
  • Constr |
  • Method
  • Detail:
  • Field |
  • Constr |
  • Method

This documentation is licensed under CC-BY 4.0, attributed to Nicolai Parlog from CodeFX.

AltStyle によって変換されたページ (->オリジナル) /