Module is.codion.common.reactive
Package is.codion.common.reactive.value
Interface Value.Builder<T,B extends Value.Builder<T,B>>
- Type Parameters:
T- the value typeB- the builder type
- All Superinterfaces:
Observer.Builder<T,B>
- All Known Subinterfaces:
ValueCollection.Builder<T,,C, B> ValueList.Builder<T>,ValueSet.Builder<T>
- All Known Implementing Classes:
AbstractValue.AbstractBuilder
Builds a
Value instance.-
Method Summary
Modifier and TypeMethodDescriptionbuild()changeConsumer(Consumer<ValueChange<? super T>> consumer) changeListener(Runnable listener) link(Observable<T> observable) Links the given observable to the resulting valueLinks the given value to the resulting valuelocked(boolean locked) notify(Value.Notify notify) validator(Value.Validator<? super T> validator) Adds a validator to the resulting valueweakChangeConsumer(Consumer<ValueChange<? super T>> weakConsumer) weakChangeListener(Runnable weakListener) Methods inherited from interface is.codion.common.reactive.observer.Observer.Builder
consumer, listener, weakConsumer, weakListener, when, when, when, when
-
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
-
locked
- Parameters:
locked- true if the value should be locked- Returns:
- this builder instance
- See Also:
-
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:
-
changeListener
- Parameters:
listener- a change listener to add- Returns:
- this builder instance
- See Also:
-
changeConsumer
- Parameters:
consumer- a change consumer to add- Returns:
- this builder instance
- See Also:
-
weakChangeListener
- Parameters:
weakListener- a weak change listener to add- Returns:
- this builder instance
- See Also:
-
weakChangeConsumer
- Parameters:
weakConsumer- a weak change consumer to add- Returns:
- this builder instance
- See Also:
-
build
- Specified by:
buildin interfaceObserver.Builder<T,B extends Value.Builder<T, B>> - Returns:
- a new
Valueinstance based on this builder
-