Class LocalizedText


  • public final class LocalizedText
    extends java.lang.Object
    Human-readable text localized to a specific locale.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalizedText​(java.lang.String text, java.lang.String locale)
      Create a LocalizedText object that contains the given text already localized to locale.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getLocale()
      Returns locale of the text in IETF BCP 47 language tag format.
      java.lang.String getText()
      Returns the localized, human-readable text.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • LocalizedText

        public LocalizedText​(java.lang.String text,
                             java.lang.String locale)
        Create a LocalizedText object that contains the given text already localized to locale.
        Parameters:
        text - Localized, human-readable text. Must not be null
        locale - IETF BCP 47 language tag of text locale. Must not be null
    • Method Detail

      • getText

        public java.lang.String getText()
        Returns the localized, human-readable text.
        Returns:
        localized, human-readable text, never null
      • getLocale

        public java.lang.String getLocale()
        Returns locale of the text in IETF BCP 47 language tag format.
        Returns:
        locale of text in IETF BCP 47 language tag format, never null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object