I thought I had a nice solution to another question I asked, but now I don't think it will work out.
In Otto, if I do something like this:
@Subscribe public void foo(ApiRequestEvent<Foo> event) {
}
@Subscribe public void bar(ApiRequestEvent<Bar> even) {
}
It seems like both methods are called if I post any instance of ApiRequestEvent<>
onto the bus. It that what is expected?
I am suspecting that this happens because in Java there is only really one class ApiRequestEvent
, and Otto is looking at the class while ignoring the type parameters.
Before I abandon this approach, is there anyway around this? I was going to use this parameterized class as the "signature" for the events I wanted to subscribe to.