Class Translation
java.lang.Object
io.goobi.viewer.model.translations.Translation
- Direct Known Subclasses:
CampaignTranslation
,CMSCollectionTranslation
,MapTranslation
,MessagesTranslation
,TermsOfUseTranslation
Abstract Translation class.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructor for Translation.Clone constructorTranslation
(String language, String value) Constructor for Translation.Translation
(String language, String tag, String value) Constructor for Translation. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Two Translations are equal if they are of the same class and both tag and language matchgetId()
Getter for the fieldid
.Getter for the fieldlanguage
.getTag()
Getter for the fieldtag
.static String
getTranslation
(List<? extends Translation> translations, String lang, String tag) getTranslation.static String
getTranslation
(List<? extends Translation> translations, String lang, String tag, boolean useFallback) getTranslation.getValue()
Getter for the fieldvalue
.int
hashCode()
Hash code is build from hashCode of languageboolean
isEmpty()
void
Setter for the fieldid
.void
setLanguage
(String language) Setter for the fieldlanguage
.void
Setter for the fieldtag
.static void
setTranslation
(List<Translation> translations, String lang, String value, String tag) void
Setter for the fieldvalue
.toString()
-
Field Details
-
id
Unique database ID. -
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
-
value
-
-
Constructor Details
-
Translation
public Translation()Constructor for Translation.
-
Translation
Constructor for Translation.
-
Translation
Constructor for Translation.
-
Translation
Clone constructor- Parameters:
t
-
-
-
Method Details
-
getTranslation
public static String getTranslation(List<? extends Translation> translations, String lang, String tag) getTranslation.
-
getTranslation
public static String getTranslation(List<? extends Translation> translations, String lang, String tag, boolean useFallback) getTranslation.
-
setTranslation
public static void setTranslation(List<Translation> translations, String lang, String value, String tag) -
getId
Getter for the field
id
.- Returns:
- the id
-
setId
Setter for the field
id
.- Parameters:
id
- the id to set
-
getTag
Getter for the field
tag
.- Returns:
- the tag
-
setTag
Setter for the field
tag
.- Parameters:
tag
- the tag to set
-
getLanguage
Getter for the field
language
.- Returns:
- the language
-
setLanguage
Setter for the field
language
.- Parameters:
language
- the language to set
-
getValue
Getter for the field
value
.- Returns:
- the value
-
setValue
Setter for the field
value
.- Parameters:
value
- the value to set
-
toString
-
hashCode
public int hashCode()Hash code is build from hashCode of language -
equals
Two Translations are equal if they are of the same class and both tag and language match -
isEmpty
public boolean isEmpty()
-