Class MessageEntry

java.lang.Object
io.goobi.viewer.model.translations.admin.MessageEntry
All Implemented Interfaces:
Comparable<MessageEntry>

public class MessageEntry extends Object implements Comparable<MessageEntry>
A single message key with all its available translations for admin backend editing.
  • Constructor Details

    • MessageEntry

      public MessageEntry(String key, List<MessageValue> values)
      Parameters:
      key -
      values -
    • MessageEntry

      public MessageEntry(String keyPrefix, String keySuffix, List<MessageValue> values)
      Constructor with a composite key.
      Parameters:
      keyPrefix -
      keySuffix -
      values -
  • Method Details

    • create

      public static MessageEntry create(String keyPrefix, String keySuffix, List<Locale> allLocales) throws IllegalArgumentException
      Factory method that creates a MessageEntry instance with values initialized for all given locales.
      Parameters:
      keyPrefix - Message key prefix (optional)
      keySuffix - Message key suffix (or entire key if no prefix)
      allLocales - List of locales
      Returns:
      new MessageEntry
      Throws:
      IllegalArgumentException - if keySuffix or allLocales is null
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(MessageEntry o)
      Specified by:
      compareTo in interface Comparable<MessageEntry>
    • getTranslationStatus

      public MessageEntry.TranslationStatus getTranslationStatus()
      Returns the translation status over all languages.
      Returns:
      appropriate MessageEntry.TranslationStatus
    • getTranslationStatusForLanguage

      public MessageEntry.TranslationStatus getTranslationStatusForLanguage(String language)
      Returns the translation status for the requested language.
      Parameters:
      language - Requested language
      Returns:
      appropriate MessageEntry.TranslationStatus
    • getKey

      public String getKey()
      Returns:
      the key
    • getKeyPrefix

      public String getKeyPrefix()
      Returns:
      the keyPrefix
    • setKeyPrefix

      public void setKeyPrefix(String keyPrefix)
      Parameters:
      keyPrefix - the keyPrefix to set
    • getKeySuffix

      public String getKeySuffix()
      Returns:
      the keySuffix
    • setKeySuffix

      public void setKeySuffix(String keySuffix)
      Parameters:
      keySuffix - the keySuffix to set
    • isKeySuffixBlank

      public boolean isKeySuffixBlank()
      Returns:
      true if keySuffix blank; false otherwise
    • getValues

      public List<MessageValue> getValues()
      Returns:
      the values
    • isNewEntryMode

      public boolean isNewEntryMode()
      Returns:
      the newEntryMode
    • setNewEntryMode

      public void setNewEntryMode(boolean newEntryMode)
      Parameters:
      newEntryMode - the newEntryMode to set