Package com.helger.commons.text
Interface IHasText
-
- All Known Subinterfaces:
IHasTextWithArgs,IMultilingualText,IMutableMultilingualText
- All Known Implementing Classes:
AbstractHasText,AbstractMapBasedMultilingualText,AbstractReadOnlyMapBasedMultilingualText,ConstantHasText,ConstantHasTextWithArgs,HasTextWithArgs,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 IHasText
Basic interface for object providing multilingual texts without arguments. See alsoIHasTextWithArgsfor a derived interface with argument handling.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default IHasDisplayTextgetAsHasDisplayText()static Comparator<IHasText>getComparatorCollating(Locale aContentLocale, Locale aSortLocale)StringgetText(Locale aContentLocale)Get the text specific for the passed locale.
-
-
-
Method Detail
-
getText
@Nullable String getText(@Nonnull Locale aContentLocale)
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.
-
getAsHasDisplayText
@Nonnull default IHasDisplayText getAsHasDisplayText()
- Returns:
- this as an instance of
IHasDisplayText. - Since:
- 8.5.2
-
-