Package com.priint.pubserver.lang
Class Translation
- java.lang.Object
-
- com.priint.pubserver.lang.Translation
-
- All Implemented Interfaces:
java.io.Serializable
public class Translation extends java.lang.Object implements java.io.SerializableList of translations for a identifier.Exposes a fluid interface.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTranslation.EntryTranslation entry associating a language with a localized text.
-
Constructor Summary
Constructors Constructor Description Translation()Translation(java.lang.String identifier, java.util.List<Translation.Entry> entries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TranslationaddEntry(@NotNull Translation.Entry entry)Add a translation entry for the identifier.TranslationaddEntry(java.lang.String lang, java.lang.String value)Add a translation entry for the identifier.java.util.List<Translation.Entry>getEntries()Get all localized values for the identifier.java.lang.StringgetIdentifier()Get the identifier for the translations.java.lang.StringgetValue()java.lang.StringgetValue(java.lang.String languageCode)Translationlocalized(java.lang.String languageCode)TranslationsetEntries(java.util.List<Translation.Entry> entries)Set the localized values for the identifier.TranslationsetIdentifier(java.lang.String identifier)Set the identifier for the translations.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Translation
public Translation()
-
Translation
public Translation(java.lang.String identifier, java.util.List<Translation.Entry> entries)
-
-
Method Detail
-
getIdentifier
public java.lang.String getIdentifier()
Get the identifier for the translations.- Returns:
- identifier of the translation
-
setIdentifier
public Translation setIdentifier(java.lang.String identifier)
Set the identifier for the translations.- Parameters:
identifier- new identifier for the translation- Returns:
- Translation for chaining.
-
getEntries
public java.util.List<Translation.Entry> getEntries()
Get all localized values for the identifier.- Returns:
- localized values for the identifier
-
setEntries
public Translation setEntries(java.util.List<Translation.Entry> entries)
Set the localized values for the identifier.- Parameters:
entries- localized entries for this translation- Returns:
- Translation for chaining.
-
addEntry
public Translation addEntry(@NotNull @NotNull Translation.Entry entry)
Add a translation entry for the identifier.- Parameters:
entry- new localized entry for this translation- Returns:
- Translation for chaining.
-
addEntry
public Translation addEntry(java.lang.String lang, java.lang.String value)
Add a translation entry for the identifier.- Parameters:
lang- language codevalue- value of translation * @return Translation for chaining.
-
localized
public Translation localized(java.lang.String languageCode)
-
getValue
public java.lang.String getValue()
-
getValue
public java.lang.String getValue(java.lang.String languageCode)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-