Record Class ActionFunction
java.lang.Object
java.lang.Record
io.github.toberocat.guiengine.function.call.ActionFunction
- All Implemented Interfaces:
GuiFunction
Custom GUI function to call an action when triggered.
Created: 29.04.2023 Author: Tobias Madlberger (Tobias)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Custom deserializer to convert JSON data into an `ActionFunction` instance. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionActionFunction
(@NotNull String action) Creates an instance of aActionFunction
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull String
action()
Returns the value of theaction
record component.void
call
(@NotNull GuiEngineApi api, @NotNull GuiContext context) Calls the specified action using the provided API and context.final boolean
Indicates whether some other object is "equal to" this one.@NotNull String
getType()
final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
ID
- See Also:
-
-
Constructor Details
-
ActionFunction
Creates an instance of aActionFunction
record class.- Parameters:
action
- the value for theaction
record component
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceGuiFunction
-
call
Calls the specified action using the provided API and context.- Specified by:
call
in interfaceGuiFunction
- Parameters:
api
- The `GuiEngineApi` instance used to interact with the GUI engine.context
- The `GuiContext` instance representing the GUI context for which the action is called.
-
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)
. -
action
Returns the value of theaction
record component.- Returns:
- the value of the
action
record component
-