Event4J
Event4J copied to clipboard
Have clients extend EventBus in order to enforce type-restrictions on events and listeners, instead of specifying them at construction type
Currently, a EventBus can be built to force events and listeners to implement a certain type. However, similar to #9 , we can just have clients extend EventBus to enforce these type-restrictions and remove our checks in EventBus. This results in cleaner, faster code for the majority of use-cases, and is consistent with our new policy of having clients override EventBus to change behavior. Even with this change, it's still pretty simple to enforce type restrictions, although we should provide a utility class/constructor to make it easier.