How does Otto handle different event classes? Is it possible to have different event classes?
Would only the listeners that listen to the specific event class get notified? E.g. would the sample below work, with only the listener in class A being notified? Assume that EventClassA
and EventClassB
does not extend the same superclass.
class A {
@Subscribe
public void handleEvent(EventClassA event)
{
//
}
}
class B {
@Subscribe
public void handleEvent(EventClassB event)
{
//
}
}
class C {
public void postEvent() {
bus.post(new EventClassA());
}
}