Package dev.sympho.bot_utils.component
Record Class ModalManager.HandlerEntry
java.lang.Object
java.lang.Record
dev.sympho.bot_utils.component.ModalManager.HandlerEntry
- Record Components:
id- The modal ID.handler- The handler to use.
- All Implemented Interfaces:
ComponentManager.HandlerEntry<ModalManager.Handler>
- Enclosing class:
- ModalManager
public static record ModalManager.HandlerEntry(String id, ModalManager.Handler handler)
extends Record
implements ComponentManager.HandlerEntry<ModalManager.Handler>
Specification for a handler to be registered.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionHandlerEntry(String id, ModalManager.Handler handler) Creates an instance of aHandlerEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.static ModalManager.HandlerEntryof(String id, ModalManager.HandlerFunction handler) Creates a handler with the given ID that uses the given function.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
Creates a handler with the given ID that uses the given function.- Parameters:
id- The modal ID.handler- The handler function to use.- Returns:
- The resulting handler.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Specified by:
idin interfaceComponentManager.HandlerEntry<ModalManager.Handler>- Returns:
- the value of the
idrecord component
-
handler
Returns the value of thehandlerrecord component.- Specified by:
handlerin interfaceComponentManager.HandlerEntry<ModalManager.Handler>- Returns:
- the value of the
handlerrecord component
-