in locales-common/src/main/java/com/spotify/i18n/locales/common/impl/ContextBasedLocalesResolverBaseImpl.java [101:131]
public abstract Builder<CONTEXT> contextToSupportedLocales(
final Function<CONTEXT, CompletionStage<Set<SupportedLocale>>> contextToSupportedLocales);
/**
* Configures the function that returns a completion stage that, when this stage completes
* normally, returns the optional {@code Accept-Language} value for the given {@link CONTEXT},
* against which locale resolution will be performed.
*
* @param contextToAcceptLanguage the function as described above
* @return The {@link Builder} instance
*/
public abstract Builder<CONTEXT> contextToAcceptLanguage(
final Function<CONTEXT, CompletionStage<Optional<String>>> contextToAcceptLanguage);
/**
* Configures the function returns a completion stage that, when this stage completes normally,
* returns the default {@link ResolvedLocale} for the given {@link CONTEXT}, which will be used
* as default/fallback resolved locale when locale resolution fails for some reason.
*
* @param contextToDefaultResolvedLocale the function as described above
* @return The {@link Builder} instance
*/
public abstract Builder<CONTEXT> contextToDefaultResolvedLocale(
final Function<CONTEXT, CompletionStage<ResolvedLocale>> contextToDefaultResolvedLocale);
abstract ContextBasedLocalesResolverBaseImpl<CONTEXT> autoBuild(); // not public
/** Builds a {@link ContextBasedLocalesResolver<CONTEXT>} out of this builder. */
public final ContextBasedLocalesResolver<CONTEXT> build() {
return autoBuild();
}