Class LocalizedString.Builder
java.lang.Object
com.lokalized.LocalizedString.Builder
- Enclosing class:
LocalizedString
Builder used to construct instances of
LocalizedString.
This class is intended for use by a single thread.
- Author:
- Mark Allen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalternatives(@Nullable List<@NonNull LocalizedString> alternatives) Applies alternative expression-driven translations to this builder.build()Constructs an instance ofLocalizedString.commentary(@Nullable String commentary) Applies commentary (usage/translation notes) to this builder.languageFormTranslationsByPlaceholder(@Nullable Map<@NonNull String, @NonNull LocalizedString.LanguageFormTranslation> languageFormTranslationsByPlaceholder) Applies per-language-form translations to this builder.translation(@Nullable String translation) Applies a default translation to this builder.
-
Constructor Details
-
Builder
-
-
Method Details
-
translation
Applies a default translation to this builder.- Parameters:
translation- a default translation, may be null- Returns:
- this builder instance, useful for chaining. not null
-
commentary
Applies commentary (usage/translation notes) to this builder.- Parameters:
commentary- commentary (usage/translation notes), may be null- Returns:
- this builder instance, useful for chaining. not null
-
languageFormTranslationsByPlaceholder
public @NonNull LocalizedString.Builder languageFormTranslationsByPlaceholder(@Nullable Map<@NonNull String, @NonNull LocalizedString.LanguageFormTranslation> languageFormTranslationsByPlaceholder) Applies per-language-form translations to this builder.- Parameters:
languageFormTranslationsByPlaceholder- per-language-form translations, may be null- Returns:
- this builder instance, useful for chaining. not null
-
alternatives
public @NonNull LocalizedString.Builder alternatives(@Nullable List<@NonNull LocalizedString> alternatives) Applies alternative expression-driven translations to this builder.- Parameters:
alternatives- alternative expression-driven translations, may be null- Returns:
- this builder instance, useful for chaining. not null
-
build
Constructs an instance ofLocalizedString.- Returns:
- an instance of
LocalizedString, not null
-