Interface TextFormat<T>

Type Parameters:
T - the result type produced by this format when applied to input text
All Superinterfaces:
Format<T>
All Known Subinterfaces:
StringFormat

public interface TextFormat<T> extends Format<T>
A specialization of Format for formats that operate solely on the input string, without regard to player context.

TextFormat implementations define a single abstract accept(String) method that transforms or interprets the provided text and returns a result of type T. The context‑aware accept overloads that take a Player simply delegate to the string‑only variant by default.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    accept(String string)
    Applies this format to the given text and returns the transformed result.
    default T
    accept(org.bukkit.entity.Player player, String string)
    Applies this format to the given text for a single player context.

    Methods inherited from interface me.croabeast.takion.format.Format

    getRegex, isFormatted, matcher, removeFormat, toFormattedString
  • Method Details

    • accept

      @NotNull T accept(String string)
      Applies this format to the given text and returns the transformed result.

      Implementations must override this method to perform the desired formatting, parsing, or transformation logic on the raw input string.

      Specified by:
      accept in interface Format<T>
      Parameters:
      string - the input text to format or process (never null)
      Returns:
      the result of applying this format to string
    • accept

      @NotNull default T accept(org.bukkit.entity.Player player, String string)
      Applies this format to the given text for a single player context.

      The default implementation ignores the player argument and delegates directly to accept(String). Override only if your format requires player-specific handling when a single Player is provided.

      Specified by:
      accept in interface Format<T>
      Parameters:
      player - the player context
      string - the input text to format or process
      Returns:
      the result of applying this format to string