public class MultilingualString extends Object
Constructor and Description |
---|
MultilingualString()
Construct an empty multilingual string
|
MultilingualString(Map<Locale,String> values)
Construct an multilingual string
|
Modifier and Type | Method and Description |
---|---|
void |
add(Locale locale,
String value)
Add or replace value for a specific locale.
|
boolean |
equals(Object obj) |
Set<Locale> |
getLocales()
Returns the existing
Locale s |
String |
getValue(Locale locale)
Returns the value in the given locale as String.
|
List<String> |
getValues()
Get all non-empty values
|
int |
hashCode() |
boolean |
hasLocale(Locale locale)
Determines if this multilingual string has value for the given locale
|
public MultilingualString()
public MultilingualString(Map<Locale,String> values)
values
- The values of each localepublic void add(Locale locale, String value)
locale
- The locale. Can not be null.value
- The value for this locale.public String getValue(Locale locale)
locale
- the locale of value to retrievenull
if not foundpublic Set<Locale> getLocales()
Locale
spublic boolean hasLocale(Locale locale)
locale
- The locale to testtrue
if a value exists for this localeAmetysRepositoryException
- if an error occurs.