Class MessageEntry
java.lang.Object
io.goobi.viewer.model.translations.admin.MessageEntry
- All Implemented Interfaces:
Comparable<MessageEntry>
A single message key with all its available translations for admin backend editing.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionMessageEntry
(String keyPrefix, String keySuffix, List<MessageValue> values) Constructor with a composite key.MessageEntry
(String key, List<MessageValue> values) -
Method Summary
Modifier and TypeMethodDescriptionint
static MessageEntry
Factory method that creates aMessageEntry
instance with values initialized for all given locales.boolean
getKey()
Returns the translation status over all languages.getTranslationStatusForLanguage
(String language) Returns the translation status for the requested language.int
hashCode()
boolean
boolean
void
setKeyPrefix
(String keyPrefix) void
setKeySuffix
(String keySuffix) void
setNewEntryMode
(boolean newEntryMode)
-
Constructor Details
-
MessageEntry
- Parameters:
key
-values
-
-
MessageEntry
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 aMessageEntry
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() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MessageEntry>
-
getTranslationStatus
Returns the translation status over all languages.- Returns:
- appropriate
MessageEntry.TranslationStatus
-
getTranslationStatusForLanguage
Returns the translation status for the requested language.- Parameters:
language
- Requested language- Returns:
- appropriate
MessageEntry.TranslationStatus
-
getKey
- Returns:
- the key
-
getKeyPrefix
- Returns:
- the keyPrefix
-
setKeyPrefix
- Parameters:
keyPrefix
- the keyPrefix to set
-
getKeySuffix
- Returns:
- the keySuffix
-
setKeySuffix
- Parameters:
keySuffix
- the keySuffix to set
-
isKeySuffixBlank
public boolean isKeySuffixBlank()- Returns:
- true if keySuffix blank; false otherwise
-
getValues
- Returns:
- the values
-
isNewEntryMode
public boolean isNewEntryMode()- Returns:
- the newEntryMode
-
setNewEntryMode
public void setNewEntryMode(boolean newEntryMode) - Parameters:
newEntryMode
- the newEntryMode to set
-