Class Events

java.lang.Object
com.thecsdev.common.event.Events

public final class Events extends Object
Factory for creating Event instances.
  • Method Details

    • createLoop

      @SafeVarargs @NotNull public static final <L> @NotNull Event<L> createLoop(@NotNull L... typeGetter)
      Creates a new Event instance with the specified listener type.
      Type Parameters:
      L - Listener type.
      Parameters:
      typeGetter - An empty array of the listener type, used to infer the listener type.
      Returns:
      A new Event instance with the specified listener type.
      Throws:
      NullPointerException - If the argument is null.
      IllegalArgumentException - If the argument is not an empty array.
    • createLoop

      @NotNull public static final <L> @NotNull Event<L> createLoop(@NotNull @NotNull Class<L> listenerType)
      Creates a new Event instance with the specified listener type.
      Type Parameters:
      L - Listener type.
      Parameters:
      listenerType - The class of the listener type.
      Returns:
      A new Event instance with the specified listener type.
      Throws:
      NullPointerException - If the argument is null.