Class LocalizedTextImpl
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<Locale,String>
-
- de.digitalcollections.model.impl.identifiable.parts.LocalizedTextImpl
-
- All Implemented Interfaces:
LocalizedText,Serializable,Cloneable,Map<Locale,String>
public class LocalizedTextImpl extends HashMap<Locale,String> implements LocalizedText
- 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 LocalizedTextImpl()LocalizedTextImpl(Locale locale, String text)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Locale>getLocales()StringgetText()StringgetText(Locale locale)voidsetText(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
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
getLocales
public Collection<Locale> getLocales()
- Specified by:
getLocalesin interfaceLocalizedText- Returns:
- all locales for which translated texts are available.
-
getText
public String getText()
- Specified by:
getTextin interfaceLocalizedText- Returns:
- first found text
-
getText
public String getText(Locale locale)
- Specified by:
getTextin interfaceLocalizedText- Parameters:
locale- the desired locale.- Returns:
- text with the given locale
-
setText
public void setText(Locale locale, String text)
Description copied from interface:LocalizedTextsets (means: "add" or "replace") a text with a given locale- Specified by:
setTextin interfaceLocalizedText- Parameters:
locale- the locale oftexttext- the text content
-
-