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
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the completeness of translations for aMessageEntryacross all configured locales. -
Constructor Summary
ConstructorsConstructorDescriptionMessageEntry(String keyPrefix, String keySuffix, List<MessageValue> values) Constructor with a composite key.MessageEntry(String key, List<MessageValue> values) -
Method Summary
Modifier and TypeMethodDescriptionintstatic MessageEntryFactory method that creates aMessageEntryinstance with values initialized for all given locales.booleangetKey()Returns the translation status over all languages.getTranslationStatusForLanguage(String language) Returns the translation status for the requested language.inthashCode()booleanbooleanvoidsetKeyPrefix(String keyPrefix) voidsetKeySuffix(String keySuffix) voidsetNewEntryMode(boolean newEntryMode)
-
Constructor Details
-
MessageEntry
- Parameters:
key- the full message keyvalues- list of translated values for this entry
-
MessageEntry
Constructor with a composite key.- Parameters:
keyPrefix- prefix part of the composite message keykeySuffix- suffix part of the composite message keyvalues- list of translated values for this entry
-
-
Method Details
-
create
public static MessageEntry create(String keyPrefix, String keySuffix, List<Locale> allLocales) throws IllegalArgumentException Factory method that creates aMessageEntryinstance 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:
compareToin 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 full message key composed of prefix and trimmed suffix
-
getKeyPrefix
-
setKeyPrefix
-
getKeySuffix
-
setKeySuffix
-
isKeySuffixBlank
public boolean isKeySuffixBlank()- Returns:
- true if keySuffix blank; false otherwise
-
getValues
-
isNewEntryMode
public boolean isNewEntryMode() -
setNewEntryMode
public void setNewEntryMode(boolean newEntryMode)
-