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 voidadd(Locale locale, String value)Add or replace value for a specific locale.booleanequals(Object obj)Set<Locale>getLocales()Returns the existingLocalesStringgetValue(Locale locale)Returns the value in the given locale as String.List<String>getValues()Get all non-empty valuesinthashCode()booleanhasLocale(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
nullif not found
-
getLocales
public Set<Locale> getLocales()
Returns the existingLocales- 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:
trueif a value exists for this locale- Throws:
AmetysRepositoryException- if an error occurs.
-
-