Interface Holder<D extends Display>

Type Parameters:
D - the type of the display
All Superinterfaces:
Initializable, Updatable
All Known Implementing Classes:
BaseHolder

public interface Holder<D extends Display> extends Initializable, Updatable
The holder for all displays
  • Method Details

    • createDisplay

      @NotNull D createDisplay(@NotNull @NotNull UUID uuid)
      Create a display with the unique id
      Parameters:
      uuid - the unique id
      Returns:
      the display
    • removeDisplay

      void removeDisplay(@NotNull @NotNull UUID uuid)
      Remove a display with the unique id
      Parameters:
      uuid - the unique id
    • getDisplay

      Optional<@NotNull D> getDisplay(@NotNull @NotNull UUID uuid)
      Get the display for the unique id
      Parameters:
      uuid - the unique id
      Returns:
      the display
    • addEventConsumer

      <T> void addEventConsumer(@NotNull @NotNull Class<T> eventClass, @NotNull @NotNull Consumer<T> eventConsumer)
      Add an event consumer
      Type Parameters:
      T - the type of the event
      Parameters:
      eventClass - the event class
      eventConsumer - the event consumer
    • clearEventConsumer

      void clearEventConsumer(@NotNull @NotNull Class<?> eventClass)
      Clear all event consumers
      Parameters:
      eventClass - the event class
    • clearAllEventConsumer

      void clearAllEventConsumer()
      Clear all event consumers of all events
    • removeAllDisplay

      void removeAllDisplay()
      Remove all displays
    • handleEvent

      void handleEvent(@NotNull @NotNull Class<?> eventClass, @NotNull @NotNull Object event)
      Handle the event
      Parameters:
      eventClass - the event class
      event - the event
    • handleEvent

      default <E> void handleEvent(@NotNull E event)
      Handle the event
      Parameters:
      event - the event
    • update

      default void update(UUID uuid)
      Update the display for the unique id
      Parameters:
      uuid - the unique id