Package nl.vpro.i18n

Interface Displayable


  • public interface Displayable
    A displayable has a getDisplayName() method, to display the object as a single string (in Locales.getDefault()) to the user.

    This interface contains only default methods, which call each other. Implementations must override at least one, either getDisplayName() if no localization is necessary or getDisplayName(Locale) if it is.

    Since:
    2.30
    Author:
    Roelof Jan Koekoek
    • Method Detail

      • getDisplayName

        default String getDisplayName()
        Returns the display value in the default locale.
      • getDisplayName

        default LocalizedString getDisplayName​(Locale locale)
        Returns a displayable name for this item in the given Locale, or the default locale (Locales.getDefault()) if not available or not implemented
        Since:
        5.11
      • getIcon

        default Optional<String> getIcon()
        An url for an icon associated with this displayable object.

        It may be that this to be interpreted relative to the current 'context path'.

      • getIconClass

        default Optional<String> getIconClass()
        An url for an icon associated with this displayable object.

        It may be that this to be interpreted relative to the current 'context path'.

      • display

        default boolean display()
        Sometimes displayable values are deprecated or experimental. Their value is possible but they should not be displayed in situations where the value is not yet present. Then this can return false.