Interface TerminationAnswerBuilder<T>

  • Type Parameters:
    T - the type of the message
    All Known Subinterfaces:
    AnswerStep1Builder<T>, AnswerStep2Builder<T>
    All Known Implementing Classes:
    AnswerBuilder

    public interface TerminationAnswerBuilder<T>
    Step defining, when the subscriber should stop answering the message and should unsubscribe.
    • Method Detail

      • until

        AnswerStep2Builder<T> until​(Class<?> eventClass)
        Defines the event, on which the the subscription should be terminated.
        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

        <R> AnswerStep2Builder<T> until​(Class<R> eventClass,
                                        Predicate<R> condition)
        Defines the event and a condition, when the subscription should be terminated.
        Type Parameters:
        R - the type of the terminating event
        Parameters:
        eventClass - the class of of the terminating event
        condition - the condition, that should hold
        Returns:
        a builder for the next step in defining the answer to a message