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.String getText()  
    java.lang.String getText​(java.util.Locale locale)  
    void setText​(java.util.Locale locale, java.lang.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
  • 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:
      getLocales in interface LocalizedText
      Returns:
      all locales for which translated texts are available.
    • getText

      public java.lang.String getText()
      Specified by:
      getText in interface LocalizedText
      Returns:
      first found text
    • getText

      public java.lang.String getText​(java.util.Locale locale)
      Specified by:
      getText in interface LocalizedText
      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: LocalizedText
      sets (means: "add" or "replace") a text with a given locale
      Specified by:
      setText in interface LocalizedText
      Parameters:
      locale - the locale of text
      text - the text content