Class Formatter
These are effectively placeholders.
- Since:
- 4.11.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic TagResolverbooleanChoice(@NotNull String key, boolean value) Creates a choice tag.static @NotNull TagResolverCreates a replacement that inserts a choice formatted text.static @NotNull TagResolverdate(@NotNull String key, @NotNull TemporalAccessor time) Creates a replacement that inserts a date or a time as a component.static TagResolverjoining(@NotNull String key, @NotNull Iterable<? extends ComponentLike> components) Creates a replacement that inserts a list of components.static TagResolverjoining(@NotNull String key, @NotNull ComponentLike @NotNull ... components) Creates a replacement that inserts a list of components.static @NotNull TagResolverCreates a replacement that inserts a number as a component.
-
Method Details
-
number
@NotNull public static @NotNull TagResolver number(@TagPattern @NotNull @NotNull String key, @NotNull @NotNull Number number) Creates a replacement that inserts a number as a component. The component will be formatted by the provided DecimalFormat.This tag accepts a locale, a format pattern, both or nothing as arguments. The locale has to be provided as first argument.
Refer to
Localefor usable locale tags. Refer toDecimalFormatfor usable patterns.This replacement is auto-closing, so its style will not influence the style of following components.
- Parameters:
key- the keynumber- the number- Returns:
- the placeholder
- Since:
- 4.11.0
-
date
@NotNull public static @NotNull TagResolver date(@TagPattern @NotNull @NotNull String key, @NotNull @NotNull TemporalAccessor time) Creates a replacement that inserts a date or a time as a component. The component will be formatted by the provided Date Format.This tag expects a format as attribute. Refer to
DateTimeFormatterfor usable patterns.This replacement is auto-closing, so its style will not influence the style of following components.
- Parameters:
key- the keytime- the time- Returns:
- the placeholder
- Since:
- 4.11.0
-
choice
@NotNull public static @NotNull TagResolver choice(@TagPattern @NotNull @NotNull String key, Number number) Creates a replacement that inserts a choice formatted text. The component will be formatted by the provided ChoiceFormat.This tag expectes a format as attribute. Refer to
ChoiceFormatfor usable patterns.This replacement is auto-closing, so its style will not influence the style of following components.
- Parameters:
key- the keynumber- the number- Returns:
- the placeholder
- Since:
- 4.11.0
-
booleanChoice
Creates a choice tag. This will use the first argument when true, otherwise the second argument.This tag expects two formats as attributes.
This replacement is auto-closing, so its style will not influence the style of following components.
- Parameters:
key- the keyvalue- the value- Returns:
- the placeholder
- Since:
- 4.13.0
-
joining
public static TagResolver joining(@TagPattern @NotNull @NotNull String key, @NotNull @NotNull Iterable<? extends ComponentLike> components) Creates a replacement that inserts a list of components. These components are joined together byComponent.join(JoinConfiguration.Builder, ComponentLike...).This tag has three optional arguments; a separator, a last separator, and a last separator if serial. Each argument must be provided in order, with all preceding arguments present. The exact use of these three separators is documented in
JoinConfiguration.This replacement is auto-closing, so its style will not influence the style of following components.
- Parameters:
key- the keycomponents- the components to join- Returns:
- the placeholder
- Since:
- 4.18.0
- See Also:
-
joining
public static TagResolver joining(@TagPattern @NotNull @NotNull String key, @NotNull @NotNull ComponentLike @NotNull ... components) Creates a replacement that inserts a list of components. These components are joined together byComponent.join(JoinConfiguration.Builder, ComponentLike...).This tag has three optional arguments; a separator, a last separator, and a last separator if serial. Each argument must be provided in order, with all preceding arguments present. The exact use of these three separators is documented in
JoinConfiguration.This replacement is auto-closing, so its style will not influence the style of following components.
- Parameters:
key- the keycomponents- the components to join- Returns:
- the placeholder
- Since:
- 4.18.0
- See Also:
-