Class DefaultStrings.Builder
java.lang.Object
com.lokalized.DefaultStrings.Builder
- Enclosing class:
DefaultStrings
Builder used to construct instances of
DefaultStrings
.
This class is intended for use by a single thread.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs an instance ofDefaultStrings
.failureMode
(DefaultStrings.FailureMode failureMode) Applies a failure mode to this builder.localeSupplier
(Function<LocaleMatcher, Locale> localeSupplier) Applies a locale supplier to this builder.localizedStringSupplier
(Supplier<Map<Locale, ? extends Iterable<LocalizedString>>> localizedStringSupplier) Applies a localized string supplier to this builder.tiebreakerLocalesByLanguageCode
(Map<String, List<Locale>> tiebreakerLocalesByLanguageCode) Applies a mapping of an ISO 639 language code to its ordered "tiebreaker" fallback locales to this builder.
-
Method Details
-
localizedStringSupplier
@Nonnull public DefaultStrings.Builder localizedStringSupplier(@Nullable Supplier<Map<Locale, ? extends Iterable<LocalizedString>>> localizedStringSupplier) Applies a localized string supplier to this builder.- Parameters:
localizedStringSupplier
- localized string supplier, may be null- Returns:
- this builder instance, useful for chaining. not null
-
localeSupplier
@Nonnull public DefaultStrings.Builder localeSupplier(@Nullable Function<LocaleMatcher, Locale> localeSupplier) Applies a locale supplier to this builder.- Parameters:
localeSupplier
- locale supplier, may be null- Returns:
- this builder instance, useful for chaining. not null
-
tiebreakerLocalesByLanguageCode
@Nonnull public DefaultStrings.Builder tiebreakerLocalesByLanguageCode(@Nullable Map<String, List<Locale>> tiebreakerLocalesByLanguageCode) Applies a mapping of an ISO 639 language code to its ordered "tiebreaker" fallback locales to this builder.- Parameters:
tiebreakerLocalesByLanguageCode
- "tiebreaker" fallback locales, may be null- Returns:
- this builder instance, useful for chaining. not null
-
failureMode
@Nonnull public DefaultStrings.Builder failureMode(@Nullable DefaultStrings.FailureMode failureMode) Applies a failure mode to this builder.- Parameters:
failureMode
- strategy for dealing with lookup failures, may be null- Returns:
- this builder instance, useful for chaining. not null
-
build
Constructs an instance ofDefaultStrings
.- Returns:
- an instance of
DefaultStrings
, not null
-