Class Translations

java.lang.Object
cz.cvut.kbss.ontodriver.model.Translations
All Implemented Interfaces:
Serializable

public final class Translations extends Object implements Serializable
Value object representing the same string in multiple languages.

This is not a general-purpose type, it should be used only in instances where multiple translations of the same string need to be treated as a single value. Its main purpose is to allow support for multilingual strings in referenced lists (e.g., Lists.loadReferencedList(ReferencedListDescriptor)).

See Also:
  • Constructor Details

    • Translations

      public Translations()
    • Translations

      public Translations(Map<String,String> value)
  • Method Details

    • set

      public void set(String language, String value)
      Sets translation in the specified language.
      Parameters:
      language - Language tag value
      value - Translation in the specified language
    • get

      public String get(String language)
      Gets translation in the specified language (if present).
      Parameters:
      language - Language tag
      Returns:
      Translation in the specified language, null if it is not available
    • getValue

      public Map<String,String> getValue()
      Gets an unmodifiable view of the internal representation of this multilingual string.
      Returns:
      Unmodifiable map
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object