Class LocalizedString.LanguageFormTranslation
java.lang.Object
com.lokalized.LocalizedString.PlaceholderDefinition
com.lokalized.LocalizedString.LanguageFormTranslation
- Enclosing class:
LocalizedString
@Immutable
public static final class LocalizedString.LanguageFormTranslation
extends LocalizedString.PlaceholderDefinition
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 or a range of values (start and end) in the case of cardinality
ranges.
Runtime values may be an explicit matching LanguageForm; cardinality and ordinality additionally accept
PluralOperands and the supported Number implementations documented by
PluralOperands.forNumber(Number). Phonetic maps accept CharSequence values, which are bounded by
TranslationRuntimeLimits.getMaximumInterpolatedOutputCharacters() before conversion and delegation to the
configured PhoneticResolver.
- 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. -
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 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.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- Throws:
NullPointerException- if the map contains a null key or value
-
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- Throws:
NullPointerException- if the map contains a null key or value
-
-
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
-
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
-