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 also IHasTextWithArgs for a derived interface with argument handling.
Author:
Philip Helger
  • Method Details

    • 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 be null.
      Returns:
      null if no text for the given locale was found.
    • getAsHasDisplayText

      @Nonnull default IHasDisplayText getAsHasDisplayText()
      Returns:
      this as an instance of IHasDisplayText.
      Since:
      8.5.2
    • getComparatorCollating

      @Nonnull static Comparator<IHasText> getComparatorCollating(@Nonnull Locale aContentLocale, @Nullable Locale aSortLocale)