public class LocalizedString extends Object implements Serializable
Constructor and Description |
---|
LocalizedString(String internationalValue)
Constructs a new localized string.
|
Modifier and Type | Method and Description |
---|---|
void |
addTranslation(String lang,
String translation)
Adds a new translation to the string.
|
boolean |
equals(LocalizedString other)
Check for equality.
|
boolean |
equals(Object obj)
Check for equality.
|
Set<String> |
getAvailableTranslationLanguages()
Available language codes this instance is translated to.
|
String |
getInternational()
Returns international string.
|
String |
getTranslation(String lang)
Returns translation for the specified language.
|
int |
hashCode()
Serves as a hash function for a particular type.
|
String |
toString()
Returns international string, if available.
|
public LocalizedString(String internationalValue)
internationalValue
- International valuepublic void addTranslation(String lang, String translation)
lang
- Language codetranslation
- Translation for this languagepublic boolean equals(LocalizedString other)
Note : Compares by the international value only.
other
- other objectpublic Set<String> getAvailableTranslationLanguages()
Note: Might be empty, then you still have the international name
public String getInternational()
public String getTranslation(String lang)
lang
- Language code (null for international string)public int hashCode()
public boolean equals(Object obj)
Copyright © 2013–2023. All rights reserved.