Class AnswerBuilder<T>
- java.lang.Object
-
- de.quantummaid.eventmaid.qcec.domainbus.internal.answer.AnswerBuilder<T>
-
- All Implemented Interfaces:
AnswerActionBuilder<T>,AnswerStep1Builder<T>,AnswerStep2Builder<T>,ConditionalAnswerBuilder<T>,TerminationAnswerBuilder<T>
public final class AnswerBuilder<T> extends Object implements AnswerStep1Builder<T>, AnswerStep2Builder<T>
-
-
Constructor Summary
Constructors Constructor Description AnswerBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> AnswerStep1Builder<T>anConstraintAnswerForClass(Class<T> constraintClass, AnswerRegister answerRegister)static <T> AnswerStep1Builder<T>anEventAnswerForClass(Class<T> queryClass, AnswerRegister answerRegister)static <T extends Query<?>>
AnswerStep1Builder<T>anQueryAnswerForClass(Class<T> queryClass, AnswerRegister answerRegister)AnswerStep1Builder<T>onlyIf(Predicate<T> condition)AnswerStep2Builder<T>until(Class<?> eventClass)Defines the event, on which the the subscription should be terminated.<R> AnswerStep2Builder<T>until(Class<R> eventClass, Predicate<R> condition)Defines the event and a condition, when the subscription should be terminated.SubscriptionIdusing(Consumer<T> consumer)Defines how to react to the message.
-
-
-
Method Detail
-
anQueryAnswerForClass
public static <T extends Query<?>> AnswerStep1Builder<T> anQueryAnswerForClass(Class<T> queryClass, AnswerRegister answerRegister)
-
anConstraintAnswerForClass
public static <T> AnswerStep1Builder<T> anConstraintAnswerForClass(Class<T> constraintClass, AnswerRegister answerRegister)
-
anEventAnswerForClass
public static <T> AnswerStep1Builder<T> anEventAnswerForClass(Class<T> queryClass, AnswerRegister answerRegister)
-
onlyIf
public AnswerStep1Builder<T> onlyIf(Predicate<T> condition)
- Specified by:
onlyIfin interfaceConditionalAnswerBuilder<T>
-
until
public AnswerStep2Builder<T> until(Class<?> eventClass)
Description copied from interface:TerminationAnswerBuilderDefines the event, on which the the subscription should be terminated.- Specified by:
untilin interfaceTerminationAnswerBuilder<T>- Parameters:
eventClass- the class of the event, that terminates the subscription- Returns:
- a builder for the next step in defining the answer to a message
-
until
public <R> AnswerStep2Builder<T> until(Class<R> eventClass, Predicate<R> condition)
Description copied from interface:TerminationAnswerBuilderDefines the event and a condition, when the subscription should be terminated.- Specified by:
untilin interfaceTerminationAnswerBuilder<T>- Type Parameters:
R- the type of the terminating event- Parameters:
eventClass- the class of of the terminating eventcondition- the condition, that should hold- Returns:
- a builder for the next step in defining the answer to a message
-
using
public SubscriptionId using(Consumer<T> consumer)
Description copied from interface:AnswerActionBuilderDefines how to react to the message.- Specified by:
usingin interfaceAnswerActionBuilder<T>- Parameters:
consumer- theconsumerto be applied on the message- Returns:
- the
SubscriptionIdof the answer
-
-