Class LocaleContainer


  • public class LocaleContainer
    extends java.lang.Object
    The purpose of this class is to support the BCP 47 format for Android versions as early as API Level 21.
    See Also:
    Locale#forLanguageTag(),
      • Constructor Summary

        Constructors 
        Constructor Description
        LocaleContainer()
        Instantiate LocaleContainer using default locale.
        LocaleContainer​(java.util.Locale locale)
        Instantiate LocaleContainer using specified locale.
      • Method Summary

        All Methods Static Methods Instance Methods Concrete Methods 
        Modifier and Type Method Description
        static LocaleContainer fromBcp47Tag​(java.lang.String bcp47Tag)
        Instantiate LocaleContainer with BCP47 tag.
        java.util.Locale getLocale()
        Get the locale as java.util.Locale class
        java.lang.String getLocaleString()
        Get the BCP47 Tag string which server returned.
        static java.lang.String toBcp47Tag​(java.util.Locale locale)
        Convert Locale class to BCP47 tag.
        java.lang.String toString()  
        • Methods inherited from class java.lang.Object

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

      • LocaleContainer

        public LocaleContainer()
        Instantiate LocaleContainer using default locale.
      • LocaleContainer

        public LocaleContainer​(java.util.Locale locale)
        Instantiate LocaleContainer using specified locale.
        Parameters:
        locale -
    • Method Detail

      • fromBcp47Tag

        public static LocaleContainer fromBcp47Tag​(java.lang.String bcp47Tag)
        Instantiate LocaleContainer with BCP47 tag.
        Parameters:
        bcp47Tag -
        Returns:
      • toBcp47Tag

        public static java.lang.String toBcp47Tag​(java.util.Locale locale)
        Convert Locale class to BCP47 tag.
        Parameters:
        locale -
        Returns:
      • getLocale

        @NonNull
        public java.util.Locale getLocale()
        Get the locale as java.util.Locale class
        Returns:
      • getLocaleString

        @Nullable
        public java.lang.String getLocaleString()
        Get the BCP47 Tag string which server returned.
        Returns:
      • toString

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