Class ConsumerListener<T>

java.lang.Object
meteordevelopment.orbit.listeners.ConsumerListener<T>
All Implemented Interfaces:
IListener

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

    • ConsumerListener

      public ConsumerListener(Class<T> target, int priority, Consumer<T> executor)
    • ConsumerListener

      public ConsumerListener(Class<T> target, Consumer<T> executor)
  • Method Details

    • call

      public void call(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 Class<T> 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