Package dev.sympho.bot_utils.component
Record Class ModalManager.Handler
java.lang.Object
java.lang.Record
dev.sympho.bot_utils.component.ModalManager.Handler
- Record Components:
handler- The handler function.
- All Implemented Interfaces:
ComponentManager.Handler<ModalManager.Handler,ModalManager.HandlerFunction>
- Enclosing class:
- ModalManager
public static record ModalManager.Handler(ModalManager.HandlerFunction handler)
extends Record
implements ComponentManager.Handler<ModalManager.Handler,ModalManager.HandlerFunction>
Specification for the handling of a modal submission.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionHandler(ModalManager.HandlerFunction handler) Creates an instance of aHandlerrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncompose(UnaryOperator<ModalManager.HandlerFunction> transform) Composes this handler by transforming its handler function.final 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.static ModalManager.Handlerof(ModalManager.HandlerFunction handler) Creates a handler that uses the given function..final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Handler
Creates an instance of aHandlerrecord class.- Parameters:
handler- the value for thehandlerrecord component
-
-
Method Details
-
compose
Description copied from interface:ComponentManager.HandlerComposes this handler by transforming its handler function.- Specified by:
composein interfaceComponentManager.Handler<ModalManager.Handler,ModalManager.HandlerFunction> - Parameters:
transform- The function to apply on the handler.- Returns:
- The Handler obtained by transforming this handler's function.
-
of
Creates a handler that uses the given function..- Parameters:
handler- The function to handle events with.- 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). -
handler
Returns the value of thehandlerrecord component.- Specified by:
handlerin interfaceComponentManager.Handler<ModalManager.Handler,ModalManager.HandlerFunction> - Returns:
- the value of the
handlerrecord component
-