Package com.helger.commons.text.resolve
Interface IEnumTextResolver
-
- All Known Implementing Classes:
AbstractEnumTextResolverWithOverrideAndFallback,DefaultTextResolver,EnumTextResolverWithPropertiesOverrideAndFallback
public interface IEnumTextResolverBase interface for an enum-based text resolver.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description StringgetText(Enum<?> aEnum, IHasText aTP, Locale aContentLocale)Get the text of an enumeration item.default StringgetTextWithArgs(Enum<?> aEnum, IHasTextWithArgs aTP, Locale aContentLocale)Deprecated.Don't call this; UsegetText(Enum, IHasText, Locale)instead when no argument is neededdefault StringgetTextWithArgs(Enum<?> aEnum, IHasTextWithArgs aTP, Locale aContentLocale, Object... aArgs)Get the text of an enumeration item with placeholder texts being replaced.
-
-
-
Method Detail
-
getText
@Nullable String getText(@Nonnull Enum<?> aEnum, @Nonnull IHasText aTP, @Nonnull Locale aContentLocale)
Get the text of an enumeration item.- Parameters:
aEnum- The enumeration item to get the unique ID of. May not benull.aTP- The text provider containing the text. May not benull.aContentLocale- The locale to be used. May not benull.- Returns:
nullif no text could be resolved.
-
getTextWithArgs
@Nullable @Deprecated(forRemoval=false) @DevelopersNote("Use getText instead when no argument is needed") default String getTextWithArgs(@Nonnull Enum<?> aEnum, @Nonnull IHasTextWithArgs aTP, @Nonnull Locale aContentLocale)
Deprecated.Don't call this; UsegetText(Enum, IHasText, Locale)instead when no argument is neededGet the text of an enumeration item.- Parameters:
aEnum- The enumeration item to get the unique ID of. May not benull.aTP- The text provider containing the text. May not benull.aContentLocale- The locale to be used. May not benull.- Returns:
nullif no text could be resolved.
-
getTextWithArgs
@Nullable default String getTextWithArgs(@Nonnull Enum<?> aEnum, @Nonnull IHasTextWithArgs aTP, @Nonnull Locale aContentLocale, @Nullable Object... aArgs)
Get the text of an enumeration item with placeholder texts being replaced.- Parameters:
aEnum- The enumeration item to get the unique ID of. May not benull.aTP- The text provider containing the text. May not benull.aContentLocale- The locale to be used. May not benull.aArgs- The arguments to be added into the string. May benullbut this makes no sense.- Returns:
nullif no text could be resolved.
-
-