Following the code example for Otto, when an event is produced, an event class is returned from the producer function:
@Produce public AnswerAvailableEvent produceAnswer() {
// Assuming 'lastAnswer' exists.
return new AnswerAvailableEvent(this.lastAnswer);
}
However, the AnswerAvailableEvent
does not seem to be defined anywhere. The only other times it is mentioned in the documentation is when the event is posted
bus.post(new AnswerAvailableEvent(42));
and when the event is received:
@Subscribe public void answerAvailable(AnswerAvailableEvent event) { ... }
Is this class automagically defined somehow? how does the class know what to do with the this.lastAnswer
parameter?
Thanks.