Interface Observer.Builder<T, B extends Observer.Builder<T,B>>
- Type Parameters:
T- the observed typeB- the builder type
- All Known Subinterfaces:
Value.Builder<T,B>, ValueCollection.Builder<T, C, B>, ValueList.Builder<T>, ValueSet.Builder<T>
- All Known Implementing Classes:
AbstractObserver.AbstractBuilder, AbstractValue.AbstractBuilder
public static interface Observer.Builder<T, B extends Observer.Builder<T,B>>
A base builder for adding listeners and consumers, extended by the builders of observable
types; there is no factory for a standalone
Observer builder.-
Method Summary
Modifier and TypeMethodDescriptionbuild()weakConsumer(Consumer<? super T> weakConsumer) weakListener(Runnable weakListener) Adds a conditional listenerAdds a conditional consumerAdds a conditional listenerAdds a conditional consumer
-
Method Details
-
listener
-
consumer
-
weakListener
-
weakConsumer
-
when
-
when
-
when
Adds a conditional listenerThe predicate is tested with each triggering value, including null, and must tolerate null input.
- Parameters:
predicate- the predicate on which to runlistener- the listener- Returns:
- this builder instance
-
when
Adds a conditional consumerThe predicate is tested with each triggering value, including null, and must tolerate null input.
- Parameters:
predicate- the predicate on which to consume the valueconsumer- the consumer to use- Returns:
- this builder instance
-
build
-