Package com.kii.cloud.storage
Class LocaleContainer
- java.lang.Object
-
- com.kii.cloud.storage.LocaleContainer
-
public class LocaleContainer extends java.lang.ObjectThe 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 LocaleContainerfromBcp47Tag(java.lang.String bcp47Tag)Instantiate LocaleContainer with BCP47 tag.java.util.LocalegetLocale()Get the locale as java.util.Locale classjava.lang.StringgetLocaleString()Get the BCP47 Tag string which server returned.static java.lang.StringtoBcp47Tag(java.util.Locale locale)Convert Locale class to BCP47 tag.java.lang.StringtoString()
-
-
-
-
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:
toStringin classjava.lang.Object
-
-