Interface Conditional<T>

Type Parameters:
T - the observed value type

public interface Conditional<T>
Provides conditional listeners for an Observer.
 selection.item()
     .when(Objects::nonNull)
     .accept(this::onSelection);

 state.when(true)
     .run(this::onEnabled);
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Specifies what action to take on a given condition.
  • Method Summary

    Modifier and Type
    Method
    Description
    when(Predicate<? super T> predicate)
    Specifies a predicate to determine when the action should be triggered.
    when(T value)
    Specifies a value to trigger the action.