Package com.lokalized
Class LocalizedString.LanguageFormTranslation
java.lang.Object
com.lokalized.LocalizedString.LanguageFormTranslation
- Enclosing class:
LocalizedString
Container for per-language-form (gender, cardinal, ordinal) translation information.
Translations can be keyed either on a single value or a range of values (start and end) in the case of cardinality ranges.
It is required to have either a value
or range
, but not both.
- Author:
- Mark Allen
-
Constructor Summary
ConstructorDescriptionLanguageFormTranslation
(LocalizedString.LanguageFormTranslationRange range, Map<LanguageForm, String> translationsByLanguageForm) Constructs a per-language-form translation set with the given placeholder range and mapping of translations by language form.LanguageFormTranslation
(String value, Map<LanguageForm, String> translationsByLanguageForm) Constructs a per-language-form translation set with the given placeholder value and mapping of translations by language form. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if this object is equal to another one.getRange()
Gets the range for this per-language-form translation set.Gets the translations by language form for this per-language-form translation set.getValue()
Gets the value for this per-language-form translation set.int
hashCode()
A hash code for this object.toString()
Generates aString
representation of this object.
-
Constructor Details
-
LanguageFormTranslation
public LanguageFormTranslation(@Nonnull String value, @Nonnull Map<LanguageForm, String> translationsByLanguageForm) Constructs a per-language-form translation set with the given placeholder value and mapping of translations by language form.- Parameters:
value
- the placeholder value to compare against for translation, not nulltranslationsByLanguageForm
- the possible translations keyed by language form, not null
-
LanguageFormTranslation
public LanguageFormTranslation(@Nonnull LocalizedString.LanguageFormTranslationRange range, @Nonnull Map<LanguageForm, String> translationsByLanguageForm) Constructs a per-language-form translation set with the given placeholder range and mapping of translations by language form.- Parameters:
range
- the placeholder range to compare against for translation, not nulltranslationsByLanguageForm
- the possible translations keyed by language form, not null
-
-
Method Details
-
toString
Generates aString
representation of this object. -
equals
Checks if this object is equal to another one. -
hashCode
A hash code for this object. -
getValue
Gets the value for this per-language-form translation set.- Returns:
- the value for this per-language-form translation set, not null
-
getRange
Gets the range for this per-language-form translation set.- Returns:
- the range for this per-language-form translation set, not null
-
getTranslationsByLanguageForm
Gets the translations by language form for this per-language-form translation set.- Returns:
- the translations by language form for this per-language-form translation set, not null
-