Interface BiFormat<T,R>

Type Parameters:
T - the type of the auxiliary argument supplied to the format
R - the result type produced by this format when applied to the input
All Superinterfaces:
Format<R>

public interface BiFormat<T,R> extends Format<R>
A Format specialization that applies formatting based on both an input string and an auxiliary argument of type T, optionally in the context of one Player instance.

BiFormat is useful when your formatting logic depends not only on the text itself but also on some external parameter (for example, a numeric threshold, a lookup key, or any other object), and optionally on player-specific context.

See Also:
  • Method Details

    • accept

      @NotNull R accept(org.bukkit.entity.Player player, T argument, String string)
      Applies this format to the given input string, using the provided auxiliary argument and optional player context.

      Implementations must define how the argument and player influence the transformation of string into an instance of R.

      Parameters:
      player - the player providing context (might be null)
      argument - an auxiliary value used in formatting (might be null)
      string - the input text to format
      Returns:
      the formatted result of type R
    • accept

      @NotNull default R accept(T argument, String string)
      Convenience overload of accept(Player, T, String) without player context.

      Delegates to accept(Player, T, String) with a null player object.

      Parameters:
      argument - an auxiliary value used in formatting (might be null)
      string - the input text to format
      Returns:
      the formatted result of type R
    • accept

      @NotNull default R accept(org.bukkit.entity.Player player, String string)
      Convenience overload of accept(Player, T, String) without auxiliary argument.

      Delegates to accept(Player, T, String) with a null argument.

      Specified by:
      accept in interface Format<T>
      Parameters:
      player - a player providing context (might be null)
      string - the input text to format
      Returns:
      the formatted result of type R