Class LocalizedTextImpl
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<java.util.Locale,java.lang.String>
de.digitalcollections.model.impl.identifiable.parts.LocalizedTextImpl
- All Implemented Interfaces:
LocalizedText,java.io.Serializable,java.lang.Cloneable,java.util.Map<java.util.Locale,java.lang.String>
public class LocalizedTextImpl extends java.util.HashMap<java.util.Locale,java.lang.String> implements LocalizedText
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,V extends java.lang.Object>Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K extends java.lang.Object,V extends java.lang.Object> -
Constructor Summary
Constructors Constructor Description LocalizedTextImpl()LocalizedTextImpl(java.util.Locale locale, java.lang.String text) -
Method Summary
Modifier and Type Method Description java.util.List<java.util.Locale>getLocales()java.lang.StringgetText()java.lang.StringgetText(java.util.Locale locale)voidsetText(java.util.Locale locale, java.lang.String text)sets (means: "add" or "replace") a text with a given localeMethods 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, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
-
Constructor Details
-
LocalizedTextImpl
public LocalizedTextImpl() -
LocalizedTextImpl
public LocalizedTextImpl(java.util.Locale locale, java.lang.String text)
-
-
Method Details
-
getLocales
public java.util.List<java.util.Locale> getLocales()- Specified by:
getLocalesin interfaceLocalizedText- Returns:
- all locales for which translated texts are available.
-
getText
public java.lang.String getText()- Specified by:
getTextin interfaceLocalizedText- Returns:
- first found text
-
getText
public java.lang.String getText(java.util.Locale locale)- Specified by:
getTextin interfaceLocalizedText- Parameters:
locale- the desired locale.- Returns:
- text with the given locale
-
setText
public void setText(java.util.Locale locale, java.lang.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
-