Interface State

All Superinterfaces:
ObservableState, Observer<Boolean>

public interface State extends ObservableState
A class encapsulating a boolean state.
 State state = State.state();

 ObservableState observable = state.observable();

 observer.addConsumer(this::onStateChange);

 state.set(true);
 state.set(false);

 boolean value = state.is();
A factory for State instances.

Listener management (add/remove) and state modifications are thread-safe

See Also: