Class Translation

java.lang.Object
io.goobi.viewer.model.translations.Translation
Direct Known Subclasses:
CampaignTranslation, CMSCollectionTranslation, MapTranslation, MessagesTranslation, TermsOfUseTranslation

@MappedSuperclass public class Translation extends Object

Abstract Translation class.

  • Field Details

    • id

      protected Long id
      Unique database ID.
    • tag

      protected String tag
      An additional optional field used to identify the purpose or categorization of a translation. Usefull if an object has more than one relationship with Translation entities and needs to distinguish them in some way
    • language

      protected String language
    • value

      protected String value
  • Constructor Details

    • Translation

      public Translation()

      Constructor for Translation.

    • Translation

      public Translation(String language, String value)

      Constructor for Translation.

      Parameters:
      language - a String object.
      value - a String object.
    • Translation

      public Translation(String language, String tag, String value)

      Constructor for Translation.

      Parameters:
      language - a String object.
      tag - a String object.
      value - a String object.
    • Translation

      public Translation(Translation t)
      Clone constructor
      Parameters:
      t -
  • Method Details

    • getTranslation

      public static String getTranslation(List<? extends Translation> translations, String lang, String tag)

      getTranslation.

      Parameters:
      tag - a String object.
      lang - a String object.
      translations - a List object.
      Returns:
      a String object.
    • getTranslation

      public static String getTranslation(List<? extends Translation> translations, String lang, String tag, boolean useFallback)

      getTranslation.

      Parameters:
      tag - a String object.
      lang - a String object.
      useFallback - if no translation for lang exists, use the application default language
      translations - a List object.
      Returns:
      a String object.
    • setTranslation

      public static void setTranslation(List<Translation> translations, String lang, String value, String tag)
    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      the id
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - the id to set
    • getTag

      public String getTag()

      Getter for the field tag.

      Returns:
      the tag
    • setTag

      public void setTag(String tag)

      Setter for the field tag.

      Parameters:
      tag - the tag to set
    • getLanguage

      public String getLanguage()

      Getter for the field language.

      Returns:
      the language
    • setLanguage

      public void setLanguage(String language)

      Setter for the field language.

      Parameters:
      language - the language to set
    • getValue

      public String getValue()

      Getter for the field value.

      Returns:
      the value
    • setValue

      public void setValue(String value)

      Setter for the field value.

      Parameters:
      value - the value to set
    • toString

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

      public int hashCode()
      Hash code is build from hashCode of language
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Two Translations are equal if they are of the same class and both tag and language match
      Overrides:
      equals in class Object
    • isEmpty

      public boolean isEmpty()