public final class I18nString extends Object implements android.os.Parcelable
defaultValue()
(optional) for non supported languages.
ISO 639-2 is used to identify the languages.
Locale.getISO3Language()
Modifier and Type | Class and Description |
---|---|
static class |
I18nString.Builder
Allows creating a I18nString in a handier way.
|
Modifier and Type | Field and Description |
---|---|
static String |
ANY_LANGUAGE
Special code, non ISO 693-2, to denote value to use by default.
|
static android.os.Parcelable.Creator<I18nString> |
CREATOR |
static I18nString |
EMPTY |
Constructor and Description |
---|
I18nString(Map<String,String> values) |
Modifier and Type | Method and Description |
---|---|
String |
defaultValue() |
int |
describeContents() |
boolean |
equals(Object o) |
String |
get(Locale locale)
Obtains the string in the provided Locale's language
Wraps
get(String) , using Locale.getISO3Language() to take language code. |
String |
get(String language)
Obtains the string in the provided language.
|
boolean |
has(String language)
Check if the language is supported by this I18nString
|
int |
hashCode() |
String |
toString() |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final I18nString EMPTY
public static final String ANY_LANGUAGE
public static final android.os.Parcelable.Creator<I18nString> CREATOR
public String get(String language)
ANY_LANGUAGE
language
- ISO 639-2 language name representation, or ANY_LANGUAGE
. If is null, will check for ANY_LANGUAGEString
. Empty if there is no value for this language, or if provided language is null or empty.public String get(Locale locale)
get(String)
, using Locale.getISO3Language()
to take language code.locale
- its Locale.getISO3Language()
stands for the language.String
. Empty if there is no value for this language.IllegalArgumentException
- if locale is nullpublic String defaultValue()
public boolean has(String language)
language
- ISO 639-2 language name representation. Not null.public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable