- Enclosing interface:
State
public static interface State.Builder
Builds a
State
instance.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Links the given state to the resulting statenotify
(Value.Notify notify) validator
(Value.Validator<? super Boolean> validator) Adds a validator to the resulting valuevalue
(boolean value) weakConsumer
(Consumer<? super Boolean> weakConsumer) weakListener
(Runnable weakListener)
-
Method Details
-
value
- Parameters:
value
- the initial value- Returns:
- this builder instance
-
notify
- Parameters:
notify
- the notify policy for this state, defaultValue.Notify.CHANGED
- Returns:
- this builder instance
-
validator
Adds a validator to the resulting value- Parameters:
validator
- the validator to add- Returns:
- this builder instance
-
link
Links the given state to the resulting state- Parameters:
originalState
- the original state to link- Returns:
- this builder instance
- See Also:
-
listener
- Parameters:
listener
- a listener to add- Returns:
- this builder instance
-
consumer
- Parameters:
consumer
- a consumer to add- Returns:
- this builder instance
-
weakListener
- Parameters:
weakListener
- a weak listener to add- Returns:
- this builder instance
-
weakConsumer
- Parameters:
weakConsumer
- a weak consumer to add- Returns:
- this builder instance
-
build
State build()- Returns:
- a new
State
instance based on this builder
-