Record Class AddComponentsFunction
java.lang.Object
java.lang.Record
io.github.toberocat.guiengine.function.call.AddComponentsFunction
- All Implemented Interfaces:
GuiFunction
public record AddComponentsFunction(@NotNull com.fasterxml.jackson.databind.JsonNode root)
extends Record
implements GuiFunction
Custom GUI function to add components to the GUI.
Created: 29.04.2023 Author: Tobias Madlberger (Tobias)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classCustom deserializer to convert JSON data into an `AddComponentsFunction` instance. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAddComponentsFunction(@NotNull com.fasterxml.jackson.databind.JsonNode root) Creates an instance of aAddComponentsFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidcall(@NotNull GuiEngineApi api, @NotNull GuiContext context) Calls the `addComponents` method using the provided API and context to add components to the GUI.final booleanIndicates whether some other object is "equal to" this one.@NotNull StringgetType()final inthashCode()Returns a hash code value for this object.@NotNull com.fasterxml.jackson.databind.JsonNoderoot()Returns the value of therootrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ID
- See Also:
-
-
Constructor Details
-
AddComponentsFunction
public AddComponentsFunction(@NotNull @NotNull com.fasterxml.jackson.databind.JsonNode root) Creates an instance of aAddComponentsFunctionrecord class.- Parameters:
root- the value for therootrecord component
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceGuiFunction
-
call
Calls the `addComponents` method using the provided API and context to add components to the GUI.- Specified by:
callin interfaceGuiFunction- Parameters:
api- The `GuiEngineApi` instance used to interact with the GUI engine.context- The `GuiContext` instance representing the GUI context to which components will be added.
-
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). -
root
@NotNull public @NotNull com.fasterxml.jackson.databind.JsonNode root()Returns the value of therootrecord component.- Returns:
- the value of the
rootrecord component
-