Module is.codion.common.core
Package is.codion.common.value
Interface Value.Builder<T,B extends Value.Builder<T,B>>
- Type Parameters:
T
- the value typeB
- the builder type
- All Known Subinterfaces:
State.Builder
,ValueList.Builder<T>
,Values.Builder<T,
,C, B> ValueSet.Builder<T>
public static interface Value.Builder<T,B extends Value.Builder<T,B>>
Builds a
Value
instance.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Links the given value to the resulting valuelink
(ValueObserver<T> originalValue) Links the given value observer to the resulting valuenotify
(Value.Notify notify) validator
(Value.Validator<? super T> validator) Adds a validator to the resulting valueweakConsumer
(Consumer<? super T> weakConsumer) weakListener
(Runnable weakListener)
-
Method Details
-
value
- Parameters:
value
- the initial value- Returns:
- this builder instance
-
notify
- Parameters:
notify
- the notify policy for this value, defaultValue.Notify.WHEN_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 value to the resulting value- Parameters:
originalValue
- the original value to link- Returns:
- this builder instance
- See Also:
-
link
Links the given value observer to the resulting value- Parameters:
originalValue
- the value 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
- Returns:
- a new
Value
instance based on this builder
-