Interface Translatable

  • All Known Subinterfaces:
    AuthenticationChallenge

    public interface Translatable
    An object encapsulating some kind of localizable message. The object can be localized based on a set of preferred localizations, typically the list of locales specified by a HTTP Accept-Language Request Header.
    Author:
    cdivilly
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.lang.String toString​(java.lang.Iterable<java.util.Locale> localePreference)
      Translate a message to the most preferred available localization
      default java.lang.String toString​(java.util.Locale locale)
      Translate a message to a specific Locale
    • Method Detail

      • toString

        java.lang.String toString​(java.lang.Iterable<java.util.Locale> localePreference)
        Translate a message to the most preferred available localization
        Parameters:
        localePreference - ordered list of Locales from most preferred to least preferred
        Returns:
        The best available translation match
      • toString

        default java.lang.String toString​(java.util.Locale locale)
        Translate a message to a specific Locale
        Parameters:
        locale - The Locale to translate to
        Returns:
        The best available translation match