Package com.helger.commons.text.display
Interface IDisplayTextProvider<DATATYPE>
-
- Type Parameters:
DATATYPE- The data type to retrieve the display text from
- 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 IDisplayTextProvider<DATATYPE>
Interface for a handler that provides the locale dependent name of an object.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static IDisplayTextProvider<IHasDisplayText>createHasDisplayText()default Comparator<DATATYPE>getComparatorCollating(Locale aContentLocale, Locale aSortLocale)StringgetDisplayText(DATATYPE aObject, Locale aContentLocale)Get the display text of the passed object in the given locale.
-
-
-
Method Detail
-
getDisplayText
@Nullable String getDisplayText(@Nullable DATATYPE aObject, @Nonnull Locale aContentLocale)
Get the display text of the passed object in the given locale.- Parameters:
aObject- The object to be used. May benull.aContentLocale- The display locale to be used. May not benull.- Returns:
- The display text of the passed object in the given locale. May be
null.
-
getComparatorCollating
@Nonnull default Comparator<DATATYPE> getComparatorCollating(@Nonnull Locale aContentLocale, @Nullable Locale aSortLocale)
-
createHasDisplayText
@Nonnull static IDisplayTextProvider<IHasDisplayText> createHasDisplayText()
-
-