Package com.helger.commons.text
Interface IHasTextWithArgs
- All Superinterfaces:
IHasText
- All Known Subinterfaces:
IMultilingualText,IMutableMultilingualText
- All Known Implementing Classes:
AbstractMapBasedMultilingualText,AbstractReadOnlyMapBasedMultilingualText,ConstantHasTextWithArgs,MultilingualText,ReadOnlyMultilingualText,ResourceBundleTextProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Basic interface for object providing multilingual texts with and without
arguments.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault IHasDisplayTextWithArgsdefault StringgetTextWithArgs(Locale aContentLocale) Deprecated.default StringgetTextWithArgs(Locale aContentLocale, Object... aArgs) Get the text specific for the passed locale.Methods inherited from interface com.helger.commons.text.IHasText
getAsHasDisplayText, getText
-
Method Details
-
getTextWithArgs
@Nullable @Deprecated(forRemoval=false) default String getTextWithArgs(@Nonnull Locale aContentLocale) Deprecated.Don't call this; UseIHasText.getText(Locale)instead!Get the text specific for the passed locale. The implementation class MAY add locale-generalisation when resolving the text ("de_DE" => "de" => default).- Parameters:
aContentLocale- The locale to use. May not benull.- Returns:
nullif no text for the given locale was found.
-
getTextWithArgs
Get the text specific for the passed locale. The implementation class MAY add locale-generalisation when resolving the text ("de_DE" => "de" => default). The placeholders will be resolved with theFormat.format(Object)method.- Parameters:
aContentLocale- The locale to use. May not benull.aArgs- The arguments to be added into the string. May benullbut this makes no sense.- Returns:
nullif no text for the given locale was found.
-
getAsHasDisplayTextWithArgs
- Returns:
- this as an instance of
IHasDisplayTextWithArgs. - Since:
- 8.5.2
-
IHasText.getText(Locale)instead!