Class DynamicTitle.DynamicTitleImpl
java.lang.Object
io.rhythmknights.coreapi.component.module.DynamicTitle.DynamicTitleImpl
- All Implemented Interfaces:
DynamicTitle
- Enclosing interface:
DynamicTitle
Simple implementation for creating dynamic titles with a function
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.rhythmknights.coreapi.component.module.DynamicTitle
DynamicTitle.DynamicTitleImpl, DynamicTitle.InteractionDynamicTitle, DynamicTitle.InteractionState, DynamicTitle.PaginatedDynamicTitle, DynamicTitle.PaginationState -
Constructor Summary
ConstructorsConstructorDescriptionDynamicTitleImpl(@NotNull Function<Object, net.kyori.adventure.text.Component> titleFunction, @NotNull Object state) Creates a dynamic title with a function that takes a state object -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.text.ComponentGet the current dynamic title based on modal state@NotNull net.kyori.adventure.text.ComponentUpdate the dynamic title with a new state object
-
Constructor Details
-
DynamicTitleImpl
public DynamicTitleImpl(@NotNull @NotNull Function<Object, net.kyori.adventure.text.Component> titleFunction, @NotNull @NotNull Object state) Creates a dynamic title with a function that takes a state object- Parameters:
titleFunction- Function to generate title based on statestate- The state object to pass to the function
-
-
Method Details
-
getDynamicTitle
@NotNull public @NotNull net.kyori.adventure.text.Component getDynamicTitle()Description copied from interface:DynamicTitleGet the current dynamic title based on modal state- Specified by:
getDynamicTitlein interfaceDynamicTitle- Returns:
- Current component title
-
update
Description copied from interface:DynamicTitleUpdate the dynamic title with a new state object- Specified by:
updatein interfaceDynamicTitle- Parameters:
state- Object containing state information for the update- Returns:
- Updated component title
-