Class LambdaListener

java.lang.Object
meteordevelopment.orbit.listeners.LambdaListener
All Implemented Interfaces:
IListener

public class LambdaListener extends Object implements IListener
Default implementation of a IListener that creates a lambda at runtime to call the target method.
  • Constructor Details

    • LambdaListener

      public LambdaListener(LambdaListener.Factory factory, Class<?> klass, Object object, Method method)
      Creates a new lambda listener, can be used for both static and non-static methods.
      Parameters:
      klass - Class of the object
      object - Object, null if static
      method - Method to create lambda for
  • 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<?> 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