Class LocalizedString.LanguageFormTranslation
java.lang.Object
com.lokalized.LocalizedString.LanguageFormTranslation
- Enclosing class:
LocalizedString
Container for per-language-form (gender, case, definiteness, classifier, formality, clusivity, animacy,
cardinal, ordinal, phonetic) translation information.
Translations can be keyed either on a single value, a range of values (start and end) in the case of cardinality ranges, or a selector-based rule set for multi-axis agreement.
Exactly one translation mode is active for each instance.
- Author:
- Mark Allen
-
Constructor Summary
ConstructorsConstructorDescriptionLanguageFormTranslation(@NonNull LocalizedString.LanguageFormTranslationRange range, @NonNull Map<@NonNull LanguageForm, @NonNull String> translationsByLanguageForm) Constructs a per-language-form translation set with the given placeholder range and mapping of translations by language form.LanguageFormTranslation(@NonNull String value, @NonNull Map<@NonNull LanguageForm, @NonNull String> translationsByLanguageForm) Constructs a per-language-form translation set with the given placeholder value and mapping of translations by language form.LanguageFormTranslation(@NonNull List<@NonNull LocalizedString.LanguageFormSelector> selectors, @NonNull List<@NonNull LocalizedString.LanguageFormTranslationRule> translationRules) Constructs a selector-based translation set with multiple agreement dimensions and ordered translation rules. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this object is equal to another one.getRange()Gets the range for this per-language-form translation set.Gets the selector definitions for this translation set.Gets the ordered translation rules for this 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.inthashCode()A hash code for this object.booleanIndicates whether this translation uses selector-based multi-axis agreement.toString()Generates aStringrepresentation of this object.
-
Constructor Details
-
LanguageFormTranslation
public LanguageFormTranslation(@NonNull String value, @NonNull Map<@NonNull LanguageForm, @NonNull 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<@NonNull LanguageForm, @NonNull 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
-
LanguageFormTranslation
public LanguageFormTranslation(@NonNull List<@NonNull LocalizedString.LanguageFormSelector> selectors, @NonNull List<@NonNull LocalizedString.LanguageFormTranslationRule> translationRules) Constructs a selector-based translation set with multiple agreement dimensions and ordered translation rules.- Parameters:
selectors- the selector definitions that determine which language forms to evaluate, not nulltranslationRules- the translation rules to evaluate against the selector values, not null
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getValue
-
getRange
Gets the range for this per-language-form translation set.- Returns:
- the range for this per-language-form translation set, not null
-
isSelectorDriven
Indicates whether this translation uses selector-based multi-axis agreement.- Returns:
- true if this translation is selector-driven, false otherwise
-
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
-
getSelectors
Gets the selector definitions for this translation set.- Returns:
- the selector definitions for this translation set, not null
-
getTranslationRules
Gets the ordered translation rules for this translation set.- Returns:
- the ordered translation rules for this translation set, not null
-