Interface EventListener<E>

    • Method Detail

      • isMatchedUsingEquals

        default boolean isMatchedUsingEquals()
        Returns:
        true if to match using equals, false to match via object identity (compared using ==). For better performance the default is false. If you implement this interface as a class overriding equals in order to being able to remove the EventListener without keeping its reference by creating a new equal EventListener instance, then you simply need to override this method returning true.
      • onEvent

        void onEvent​(E event)
        This method is called if an event occurred.
        WARNING:
        Depending on the implementation of EventSource it may NOT be legal to add or remove listeners during the call of this method as this may lead to a dead-lock.
        Parameters:
        event - is the event that notifies about something that happened.