Package me.hsgamer.hscore.ui
Interface Holder<D extends Display>
- Type Parameters:
D- the type of the display
- All Superinterfaces:
Initializable,Updatable
- All Known Implementing Classes:
BaseHolder
The holder for all displays
-
Method Summary
Modifier and TypeMethodDescription<T> voidaddEventConsumer(@NotNull Class<T> eventClass, @NotNull Consumer<T> eventConsumer) Add an event consumervoidClear all event consumers of all eventsvoidclearEventConsumer(@NotNull Class<?> eventClass) Clear all event consumerscreateDisplay(@NotNull UUID uuid) Create a display with the unique idgetDisplay(@NotNull UUID uuid) Get the display for the unique idvoidhandleEvent(@NotNull Class<?> eventClass, @NotNull Object event) Handle the eventdefault <E> voidhandleEvent(E event) Handle the eventvoidRemove all displaysvoidremoveDisplay(@NotNull UUID uuid) Remove a display with the unique iddefault voidUpdate the display for the unique idMethods inherited from interface me.hsgamer.hscore.ui.property.Initializable
init, stop
-
Method Details
-
createDisplay
Create a display with the unique id- Parameters:
uuid- the unique id- Returns:
- the display
-
removeDisplay
Remove a display with the unique id- Parameters:
uuid- the unique id
-
getDisplay
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 classeventConsumer- the event consumer
-
clearEventConsumer
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
Handle the event- Parameters:
eventClass- the event classevent- the event
-
handleEvent
default <E> void handleEvent(@NotNull E event) Handle the event- Parameters:
event- the event
-
update
Update the display for the unique id- Parameters:
uuid- the unique id
-