What is events in Otto and are there types of events that could be published using OTTO?

148 views Asked by At

Iam just a bit confused with what type of events can be published through OTTO. and a example of event class will be really helpful. Thanks

1

There are 1 answers

0
sergej shafarenka On BEST ANSWER

You can publish any objects. Check the Otto home page. There you see an example where AnswerAvailableEvent event gets published. Event class can look like this.

public class AnswerAvailableEvent {
    private int answer;

    public AnswerAvailableEvent(int answer) {
      this.answer = answer;
    }

    public int getAnswer() {
      return answer;
    }
}