0

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

Avijeet
  • 1,031
  • 1
  • 10
  • 27

1 Answers1

0

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;
    }
}
sergej shafarenka
  • 20,071
  • 7
  • 67
  • 86