Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_LANGUAGE_TAG
Default language tag.
|
Constructor and Description |
---|
LocalizedString(String source)
Creates an instance by parsing the source string that must be on the format
<lang-tag>-<string according to
language> . |
LocalizedString(String localString,
Locale locale)
Constructor.
|
LocalizedString(String localString,
String language)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines if two LocalizedStrings are equal, that is, if both thier localized string and language have
case-sentivite equality.
|
String |
getLanguage()
Gets the language of the string.
|
String |
getLocalString()
Gets the localized string.
|
int |
hashCode() |
void |
setLanguage(String newLanguage)
Sets the language of the string.
|
void |
setLocalizedString(String newString)
Sets the localized string.
|
String |
toString() |
public static final String DEFAULT_LANGUAGE_TAG
public LocalizedString(String source)
<lang-tag>-<string according to
language>
. The string "en-Hello" will give a LocalizedString where:
ls.getLanguage() => "en"
ls.getLocalString() => "Hello"
source
- the string to parsepublic LocalizedString(String localString, String language)
localString
- the localized stringlanguage
- the language of the stringpublic LocalizedString(String localString, Locale locale)
localString
- the localized stringlocale
- the locale (the language is obtained using Locale.getLanguage()
)public String getLocalString()
public void setLocalizedString(String newString)
newString
- the localized stringpublic String getLanguage()
public void setLanguage(String newLanguage)
newLanguage
- the language of the stringpublic boolean equals(Object obj)
Copyright © 2018 Litsec AB. All rights reserved.