Record Class EditComponentFunction
java.lang.Object
java.lang.Record
io.github.toberocat.guiengine.function.call.EditComponentFunction
- All Implemented Interfaces:
GuiFunction
public record EditComponentFunction(@NotNull String target, @NotNull String attribute, @NotNull String value)
extends Record
implements GuiFunction
Custom GUI function to edit a component's attribute in the GUI.
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 `EditComponentFunction` instance. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEditComponentFunction
(@NotNull String target, @NotNull String attribute, @NotNull String value) Creates an instance of aEditComponentFunction
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull String
Returns the value of theattribute
record component.void
call
(@NotNull GuiEngineApi api, @NotNull GuiContext context) Calls the `editXmlComponentById` method using the provided API and context to edit a component's attribute in the GUI.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.@NotNull String
target()
Returns the value of thetarget
record component.final String
toString()
Returns a string representation of this record class.@NotNull String
value()
Returns the value of thevalue
record component.
-
Field Details
-
ID
- See Also:
-
-
Constructor Details
-
EditComponentFunction
public EditComponentFunction(@NotNull @NotNull String target, @NotNull @NotNull String attribute, @NotNull @NotNull String value) Creates an instance of aEditComponentFunction
record class.- Parameters:
target
- the value for thetarget
record componentattribute
- the value for theattribute
record componentvalue
- the value for thevalue
record component
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceGuiFunction
-
call
Calls the `editXmlComponentById` method using the provided API and context to edit a component's attribute in the GUI.- 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 in which the component exists.
-
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)
. -
target
Returns the value of thetarget
record component.- Returns:
- the value of the
target
record component
-
attribute
Returns the value of theattribute
record component.- Returns:
- the value of the
attribute
record component
-
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-