Class ConsumerListener<T>

  • All Implemented Interfaces:
    IListener

    public class ConsumerListener<T>
    extends java.lang.Object
    implements IListener
    Listener that takes in a Consumer.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConsumerListener​(java.lang.Class<?> target, int priority, java.util.function.Consumer<T> executor)  
      ConsumerListener​(java.lang.Class<?> target, java.util.function.Consumer<T> executor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void call​(java.lang.Object event)
      Calls the listener with the specified event.
      int getPriority()  
      java.lang.Class<?> getTarget()  
      boolean isStatic()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConsumerListener

        public ConsumerListener​(java.lang.Class<?> target,
                                int priority,
                                java.util.function.Consumer<T> executor)
      • ConsumerListener

        public ConsumerListener​(java.lang.Class<?> target,
                                java.util.function.Consumer<T> executor)
    • Method Detail

      • call

        public void call​(java.lang.Object event)
        Description copied from interface: IListener
        Calls the listener with the specified event.
        Specified by:
        call in interface IListener
        Parameters:
        event - Event to pass in
      • getTarget

        public java.lang.Class<?> getTarget()
        Specified by:
        getTarget in interface IListener
        Returns:
        The target event type this listener is for
      • getPriority

        public int getPriority()
        Specified by:
        getPriority in interface IListener
        Returns:
        The priority for this listener
      • isStatic

        public boolean isStatic()
        Specified by:
        isStatic in interface IListener
        Returns:
        True if this listener is for static methods