Class MultilingualString
- java.lang.Object
-
- org.ametys.plugins.repository.metadata.MultilingualString
-
public class MultilingualString extends Object
Class representing a multilingual String
-
-
Constructor Summary
Constructors Constructor Description MultilingualString()
Construct an empty multilingual stringMultilingualString(Map<Locale,String> values)
Construct an multilingual string
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Locale locale, String value)
Add or replace value for a specific locale.boolean
equals(Object obj)
Set<Locale>
getLocales()
Returns the existingLocale
sString
getValue(Locale locale)
Returns the value in the given locale as String.List<String>
getValues()
Get all non-empty valuesint
hashCode()
boolean
hasLocale(Locale locale)
Determines if this multilingual string has value for the given locale
-
-
-
Constructor Detail
-
MultilingualString
public MultilingualString()
Construct an empty multilingual string
-
MultilingualString
public MultilingualString(Map<Locale,String> values)
Construct an multilingual string- Parameters:
values
- The values of each locale
-
-
Method Detail
-
add
public void add(Locale locale, String value)
Add or replace value for a specific locale.- Parameters:
locale
- The locale. Can not be null.value
- The value for this locale.
-
getValue
public String getValue(Locale locale)
Returns the value in the given locale as String.- Parameters:
locale
- the locale of value to retrieve- Returns:
- the value as String or
null
if not found
-
getLocales
public Set<Locale> getLocales()
Returns the existingLocale
s- Returns:
- the locales
-
hasLocale
public boolean hasLocale(Locale locale)
Determines if this multilingual string has value for the given locale- Parameters:
locale
- The locale to test- Returns:
true
if a value exists for this locale- Throws:
AmetysRepositoryException
- if an error occurs.
-
-