Module is.codion.common.reactive
Package is.codion.common.reactive.value
Class AbstractValue.AbstractBuilder<T,B extends Value.Builder<T,B>>
java.lang.Object
is.codion.common.reactive.value.AbstractValue.AbstractBuilder<T,B>
- Type Parameters:
T- the value typeB- the builder type
- All Implemented Interfaces:
Value.Builder<T,B>
- Enclosing class:
AbstractValue<T>
public abstract static class AbstractValue.AbstractBuilder<T,B extends Value.Builder<T,B>>
extends Object
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<ValueChange<? super T>> consumer) final BchangeListener(Runnable listener) final Bfinal Blink(Observable<T> observable) Links the given observable to the resulting valuefinal BLinks the given value to the resulting valuefinal Bfinal 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<ValueChange<? super T>> weakConsumer) final BweakChangeListener(Runnable weakListener) final BweakConsumer(Consumer<? super T> weakConsumer) final BweakListener(Runnable weakListener) final BAdds a conditional listenerfinal BAdds a conditional consumerfinal BAdds a conditional listenerfinal BAdds a conditional consumerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface is.codion.common.reactive.value.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:
-
listener
- Specified by:
listenerin interfaceValue.Builder<T,B extends Value.Builder<T, B>> - Parameters:
listener- a listener to add- Returns:
- this builder instance
-
consumer
- Specified by:
consumerin interfaceValue.Builder<T,B extends Value.Builder<T, B>> - Parameters:
consumer- a consumer to add- Returns:
- this builder instance
-
weakListener
- Specified by:
weakListenerin interfaceValue.Builder<T,B extends Value.Builder<T, B>> - Parameters:
weakListener- a weak listener to add- Returns:
- this builder instance
-
weakConsumer
- Specified by:
weakConsumerin interfaceValue.Builder<T,B extends Value.Builder<T, B>> - Parameters:
weakConsumer- a weak consumer to add- Returns:
- this builder instance
-
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:
-
when
Description copied from interface:Value.BuilderAdds a conditional listener- Specified by:
whenin interfaceValue.Builder<T,B extends Value.Builder<T, B>> - Parameters:
value- the value on which to runlistener- the listener- Returns:
- this builder instance
-
when
Description copied from interface:Value.BuilderAdds a conditional consumer- Specified by:
whenin interfaceValue.Builder<T,B extends Value.Builder<T, B>> - Parameters:
value- the value to consumeconsumer- the consumer- Returns:
- this builder instance
-
when
Description copied from interface:Value.BuilderAdds a conditional listener- Specified by:
whenin interfaceValue.Builder<T,B extends Value.Builder<T, B>> - Parameters:
predicate- the predicate on which to runlistener- the runnable- Returns:
- this builder instance
-
when
Description copied from interface:Value.BuilderAdds a conditional consumer- Specified by:
whenin interfaceValue.Builder<T,B extends Value.Builder<T, B>> - Parameters:
predicate- the predicate on which to consume the valueconsumer- the consumer to use- Returns:
- this builder instance
-
prepareInitialValue
- Returns:
- the initial value
-