Package dev.sympho.bot_utils.component
Record Class ButtonManager.HandlerEntry
java.lang.Object
java.lang.Record
dev.sympho.bot_utils.component.ButtonManager.HandlerEntry
- Record Components:
id- The button ID.handler- The handler to use.mutex- Iftrue, the given handler is converted into amutexbefore registering.
- All Implemented Interfaces:
ComponentManager.HandlerEntry<ButtonManager.Handler>
- Enclosing class:
- ButtonManager
public static record ButtonManager.HandlerEntry(String id, ButtonManager.Handler handler, boolean mutex)
extends Record
implements ComponentManager.HandlerEntry<ButtonManager.Handler>
Specification for a handler to be registered.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionHandlerEntry(String id, ButtonManager.Handler handler, boolean mutex) 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.booleanmutex()Returns the value of themutexrecord component.static ButtonManager.HandlerEntryof(String id, ButtonManager.HandlerFunction handler, boolean mutex) Creates a handler with the given ID that uses the given function and requires no groups.static ButtonManager.HandlerEntryof(String id, ButtonManager.HandlerFunction handler, boolean mutex, Group group) Creates a handler with the given ID that uses the given function and requires the given group.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
public static ButtonManager.HandlerEntry of(String id, ButtonManager.HandlerFunction handler, boolean mutex, Group group) Creates a handler with the given ID that uses the given function and requires the given group.- Parameters:
id- The button ID.handler- The handler function to use.mutex- Iftrue, the handler will be converted into amutexbefore registering.group- The group that the user must have access to in order to use the button.- Returns:
- The resulting handler.
-
of
public static ButtonManager.HandlerEntry of(String id, ButtonManager.HandlerFunction handler, boolean mutex) Creates a handler with the given ID that uses the given function and requires no groups.- Parameters:
id- The button ID.handler- The handler function to use.mutex- Iftrue, the handler will be converted into amutexbefore registering.- 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Specified by:
idin interfaceComponentManager.HandlerEntry<ButtonManager.Handler>- Returns:
- the value of the
idrecord component
-
handler
Returns the value of thehandlerrecord component.- Specified by:
handlerin interfaceComponentManager.HandlerEntry<ButtonManager.Handler>- Returns:
- the value of the
handlerrecord component
-
mutex
public boolean mutex()Returns the value of themutexrecord component.- Returns:
- the value of the
mutexrecord component
-