- Enclosing interface:
- State
public static interface State.Builder
Builds a
State
instance.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Links the given value to the resulting statelink
(ValueObserver<Boolean> originalState) Links the given value observer to the resulting statenotify
(Value.Notify notify) validator
(Value.Validator<Boolean> validator) Adds a validator to the resulting stateweakConsumer
(Consumer<Boolean> weakConsumer) weakListener
(Runnable weakListener)
-
Method Details
-
notify
- Parameters:
notify
- the notify policy for this value, defaultValue.Notify.WHEN_CHANGED
- Returns:
- this builder instance
-
validator
Adds a validator to the resulting state- Parameters:
validator
- the validator to add- Returns:
- this builder instance
-
link
Links the given value to the resulting state- Parameters:
originalState
- the original state to link- Returns:
- this builder instance
- See Also:
-
link
Links the given value observer to the resulting state- Parameters:
originalState
- the 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
-