Replace includeSubtypes with @Polymorphic
The new @Polymorphic annotation serves the exact same purpose as @Event(includeSubtypes = true), but should be easier to read in complex handler declarations. It has to be used in conjunction with the @Event annotation, not instead of it.
This commit is contained in:
@ -104,7 +104,7 @@ public final class EventBus {
|
||||
for (var binding : bindings.entrySet())
|
||||
if (binding.getKey().isAssignableFrom(eventClass))
|
||||
for (var handler : binding.getValue())
|
||||
if (handler.includeSubtypes())
|
||||
if (handler.isPolymorphic())
|
||||
handlers.add(handler);
|
||||
|
||||
return new ArrayList<>(handlers);
|
||||
|
Reference in New Issue
Block a user