Interface State.Builder

Enclosing interface:
State

public static interface State.Builder
Builds a State instance.
  • Method Details

    • value

      State.Builder value(boolean value)
      Parameters:
      value - the initial value
      Returns:
      this builder instance
    • notify

      State.Builder notify(Value.Notify notify)
      Parameters:
      notify - the notify policy for this state, default Value.Notify.CHANGED
      Returns:
      this builder instance
    • validator

      State.Builder validator(Value.Validator<? super Boolean> validator)
      Adds a validator to the resulting value
      Parameters:
      validator - the validator to add
      Returns:
      this builder instance
    • link

      State.Builder link(State originalState)
      Links the given state to the resulting state
      Parameters:
      originalState - the original state to link
      Returns:
      this builder instance
      See Also:
    • listener

      State.Builder listener(Runnable listener)
      Parameters:
      listener - a listener to add
      Returns:
      this builder instance
    • consumer

      State.Builder consumer(Consumer<? super Boolean> consumer)
      Parameters:
      consumer - a consumer to add
      Returns:
      this builder instance
    • weakListener

      State.Builder weakListener(Runnable weakListener)
      Parameters:
      weakListener - a weak listener to add
      Returns:
      this builder instance
    • weakConsumer

      State.Builder weakConsumer(Consumer<? super Boolean> weakConsumer)
      Parameters:
      weakConsumer - a weak consumer to add
      Returns:
      this builder instance
    • build

      State build()
      Returns:
      a new State instance based on this builder