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:
ValueCollection.Builder<T,,C, B> ValueList.Builder<T>,ValueSet.Builder<T>
public static interface Value.Builder<T,B extends Value.Builder<T,B>>
Builds a
Value instance.-
Method Summary
Modifier and TypeMethodDescriptionbuild()link(Observable<T> observable) Links the given observable to the resulting valueLinks the given value 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.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 observable to the resulting value- Parameters:
observable- 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
Valueinstance based on this builder
-