Package de.digitalcollections.model.text
Class LocalizedText
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<Locale,String>
-
- de.digitalcollections.model.text.LocalizedText
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Locale,String>
public class LocalizedText extends HashMap<Locale,String>
LocalizedText is used for unformatted text content in multiple languages.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description LocalizedText()
LocalizedText(Locale locale, String text)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Locale>
getLocales()
String
getText()
String
getText(Locale locale)
boolean
has(Locale locale)
void
setText(Locale locale, String text)
sets (means: "add" or "replace") a text with a given locale-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Method Detail
-
getLocales
public List<Locale> getLocales()
- Returns:
- all locales for which translated texts are available.
-
getText
public String getText()
- Returns:
- first found text
-
getText
public String getText(Locale locale)
- Parameters:
locale
- the desired locale.- Returns:
- text with the given locale
-
has
public boolean has(Locale locale)
-
-