Class GuiComponentPropertyFunction

java.lang.Object
io.github.toberocat.guiengine.function.compute.GuiComponentPropertyFunction
All Implemented Interfaces:
ComputeFunction

public class GuiComponentPropertyFunction extends Object implements ComputeFunction
Custom compute function to extract properties of GUI components.

Created: 30.04.2023 Author: Tobias Madlberger (Tobias)

  • 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 interface ComputeFunction
      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

      public boolean checkForFunction(@NotNull @NotNull String value)
      Checks if the provided value contains the function to extract a GUI component attribute.
      Specified by:
      checkForFunction in interface ComputeFunction
      Parameters:
      value - The input value to check for the function.
      Returns:
      `true` if the function is present in the value, `false` otherwise.