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.
@FunctionalInterface public interface IHasTextWithArgs extends IHasText
Basic interface for object providing multilingual texts with and without arguments.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default IHasDisplayTextWithArgsgetAsHasDisplayTextWithArgs()default StringgetTextWithArgs(Locale aContentLocale)Deprecated.Don't call this; UseIHasText.getText(Locale)instead!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 Detail
-
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
@Nullable default String getTextWithArgs(@Nonnull Locale aContentLocale, @Nullable Object... aArgs)
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
@Nonnull default IHasDisplayTextWithArgs getAsHasDisplayTextWithArgs()
- Returns:
- this as an instance of
IHasDisplayTextWithArgs. - Since:
- 8.5.2
-
-