Class AbstractValue.AbstractBuilder<T, B extends Value.Builder<T,B>>
java.lang.Object
is.codion.common.reactive.observer.AbstractObserver.AbstractBuilder<T,B>
is.codion.common.reactive.value.AbstractValue.AbstractBuilder<T,B>
- Type Parameters:
T- the value typeB- the builder type
- All Implemented Interfaces:
Observer.Builder<T,B>, Value.Builder<T, B>
- Enclosing class:
AbstractValue<T>
public abstract static class AbstractValue.AbstractBuilder<T, B extends Value.Builder<T,B>>
extends AbstractObserver.AbstractBuilder<T,B>
An abstract base class for a value builder
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiates a new builderprotectedAbstractBuilder(T nullValue) Instantiates a new builder -
Method Summary
Modifier and TypeMethodDescriptionfinal BchangeConsumer(Consumer<Change<T>> consumer) final BchangeListener(Runnable listener) final Blink(Observable<T> observable) Links the given observable to the resulting valuefinal BLinks the given value to the resulting valuefinal Blocked(boolean locked) final Bnotify(Value.Notify notify) protected Tfinal Bvalidator(Value.Validator<? super T> validator) Adds a validator to the resulting valuefinal Bfinal BweakChangeConsumer(Consumer<Change<T>> weakConsumer) final BweakChangeListener(Runnable weakListener) Methods inherited from class AbstractObserver.AbstractBuilder
consumer, listener, self, weakConsumer, weakListener, when, when, when, whenMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Observer.Builder
consumer, listener, weakConsumer, weakListener, when, when, when, whenMethods inherited from interface Value.Builder
build
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()Instantiates a new builder -
AbstractBuilder
Instantiates a new builder- Parameters:
nullValue- the null value, also used as the initial value- Throws:
NullPointerException- in casenullValueis null
-
-
Method Details
-
value
- Specified by:
valuein interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
value- the initial value- Returns:
- this builder instance
-
notify
- Specified by:
notifyin interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
notify- the notify policy for this value, defaultValue.Notify.CHANGED- Returns:
- this builder instance
-
validator
Description copied from interface:Value.BuilderAdds a validator to the resulting value- Specified by:
validatorin interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
validator- the validator to add- Returns:
- this builder instance
-
locked
- Specified by:
lockedin interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
locked- true if the value should be locked- Returns:
- this builder instance
- See Also:
-
link
Description copied from interface:Value.BuilderLinks the given value to the resulting value- Specified by:
linkin interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
originalValue- the original value to link- Returns:
- this builder instance
- See Also:
-
link
Description copied from interface:Value.BuilderLinks the given observable to the resulting value- Specified by:
linkin interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
observable- the value to link- Returns:
- this builder instance
- See Also:
-
changeListener
- Specified by:
changeListenerin interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
listener- a change listener to add- Returns:
- this builder instance
- See Also:
-
changeConsumer
- Specified by:
changeConsumerin interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
consumer- a change consumer to add- Returns:
- this builder instance
- See Also:
-
weakChangeListener
- Specified by:
weakChangeListenerin interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
weakListener- a weak change listener to add- Returns:
- this builder instance
- See Also:
-
weakChangeConsumer
- Specified by:
weakChangeConsumerin interfaceValue.Builder<T, B extends Value.Builder<T,B>> - Parameters:
weakConsumer- a weak change consumer to add- Returns:
- this builder instance
- See Also:
-
prepareInitialValue
- Returns:
- the initial value
-