Class GuiComponentPropertyFunction
java.lang.Object
io.github.toberocat.guiengine.function.compute.GuiComponentPropertyFunction
- All Implemented Interfaces:
ComputeFunction
Custom compute function to extract properties of GUI components.
Created: 30.04.2023 Author: Tobias Madlberger (Tobias)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkForFunction
(@NotNull String value) Checks if the provided value contains the function to extract a GUI component attribute.@NotNull String
compute
(@NotNull GuiEngineApi api, @NotNull GuiContext context, @NotNull String value) Computes the value of the provided placeholder, which represents a attribute of a GUI component.
-
Constructor Details
-
GuiComponentPropertyFunction
public GuiComponentPropertyFunction()
-
-
Method Details
-
compute
@NotNull public @NotNull String compute(@NotNull @NotNull GuiEngineApi api, @NotNull @NotNull GuiContext context, @NotNull @NotNull String value) Computes the value of the provided placeholder, which represents a attribute of a GUI component.- Specified by:
compute
in interfaceComputeFunction
- Parameters:
api
- The `GuiEngineApi` instance used to interact with the GUI engine.context
- The `GuiContext` instance representing the GUI context for which the computation is performed.value
- The input value containing the placeholder to compute.- Returns:
- The computed value of the placeholder representing the attribute of a GUI component.
-
checkForFunction
Checks if the provided value contains the function to extract a GUI component attribute.- Specified by:
checkForFunction
in interfaceComputeFunction
- Parameters:
value
- The input value to check for the function.- Returns:
- `true` if the function is present in the value, `false` otherwise.
-