Interface ComputeFunction

All Known Implementing Classes:
GuiComponentPropertyFunction, HasNotPermissionFunction, HasPermissionFunction

public interface ComputeFunction
Interface for defining custom compute functions for GUI placeholders.

Created: 30.04.2023 Author: Tobias Madlberger (Tobias)

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkForFunction(@NotNull String value)
    Checks if the provided value contains the function to be computed.
    @NotNull String
    compute(@NotNull GuiEngineApi api, @NotNull GuiContext context, @NotNull String value)
    Computes the value of the provided placeholder.
  • Method Details

    • compute

      @NotNull @NotNull String compute(@NotNull @NotNull GuiEngineApi api, @NotNull @NotNull GuiContext context, @NotNull @NotNull String value)
      Computes the value of the provided placeholder.
      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.
    • checkForFunction

      boolean checkForFunction(@NotNull @NotNull String value)
      Checks if the provided value contains the function to be computed.
      Parameters:
      value - The input value to check for the function.
      Returns:
      `true` if the function is present in the value, `false` otherwise.