@ConfigurationProperties(value="locale-resolution") public static class HttpServerConfiguration.HttpLocaleResolutionConfigurationProperties extends Object implements HttpLocaleResolutionConfiguration
HttpLocaleResolver
.Constructor and Description |
---|
HttpLocaleResolutionConfigurationProperties() |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getCookieName() |
Locale |
getDefaultLocale() |
Optional<Locale> |
getFixed() |
Optional<String> |
getSessionAttribute() |
boolean |
isHeader() |
void |
setCookieName(String cookieName)
Sets the name of the cookie that is used to store the locale.
|
void |
setDefaultLocale(Locale defaultLocale)
Sets the locale that will be used if the locale cannot be
resolved through any means.
|
void |
setFixed(Locale fixed)
Set the language tag for the locale.
|
void |
setHeader(boolean header)
Set to true if the locale should be resolved from the `Accept-Language` header.
|
void |
setSessionAttribute(String sessionAttribute)
Sets the key in the session to look for the locale.
|
public static final String PREFIX
public HttpLocaleResolutionConfigurationProperties()
@NonNull public Optional<Locale> getFixed()
getFixed
in interface LocaleResolutionConfiguration
public void setFixed(@Nullable Locale fixed)
fixed
- The fixed locale@NonNull public Optional<String> getSessionAttribute()
getSessionAttribute
in interface HttpLocaleResolutionConfiguration
public void setSessionAttribute(@Nullable String sessionAttribute)
sessionAttribute
- The session attribute key@NonNull public Locale getDefaultLocale()
getDefaultLocale
in interface LocaleResolutionConfiguration
public void setDefaultLocale(@NonNull Locale defaultLocale)
defaultLocale
- The default locale.@NonNull public Optional<String> getCookieName()
getCookieName
in interface HttpLocaleResolutionConfiguration
public void setCookieName(@Nullable String cookieName)
cookieName
- The name of the cookie used to store the localepublic boolean isHeader()
isHeader
in interface HttpLocaleResolutionConfiguration
public void setHeader(boolean header)
header
- Header resolution