Package me.croabeast.takion.format
Interface BiFormat<T,R>
- Type Parameters:
T- the type of the auxiliary argument supplied to the formatR- the result type produced by this format when applied to the input
- All Superinterfaces:
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 Summary
Modifier and TypeMethodDescriptiondefault RConvenience overload ofaccept(Player, T, String)without auxiliary argument.Applies this format to the given input string, using the provided auxiliary argument and optional player context.default RConvenience overload ofaccept(Player, T, String)without player context.Methods inherited from interface me.croabeast.takion.format.Format
accept, getRegex, isFormatted, matcher, removeFormat, toFormattedString
-
Method Details
-
accept
Applies this format to the given input string, using the provided auxiliary argument and optional player context.Implementations must define how the
argumentandplayerinfluence the transformation ofstringinto an instance ofR.- Parameters:
player- the player providing context (might benull)argument- an auxiliary value used in formatting (might benull)string- the input text to format- Returns:
- the formatted result of type
R
-
accept
Convenience overload ofaccept(Player, T, String)without player context.Delegates to
accept(Player, T, String)with anullplayer object.- Parameters:
argument- an auxiliary value used in formatting (might benull)string- the input text to format- Returns:
- the formatted result of type
R
-
accept
Convenience overload ofaccept(Player, T, String)without auxiliary argument.Delegates to
accept(Player, T, String)with anullargument.
-