Class HttpServerConfiguration.HttpLocaleResolutionConfigurationProperties

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PREFIX  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> getCookieName()  
      java.util.Locale getDefaultLocale()  
      java.util.Optional<java.util.Locale> getFixed()  
      java.util.Optional<java.lang.String> getSessionAttribute()  
      boolean isHeader()  
      void setCookieName​(java.lang.String cookieName)
      Sets the name of the cookie that is used to store the locale.
      void setDefaultLocale​(java.util.Locale defaultLocale)
      Sets the locale that will be used if the locale cannot be resolved through any means.
      void setFixed​(java.util.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​(java.lang.String sessionAttribute)
      Sets the key in the session to look for the locale.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpLocaleResolutionConfigurationProperties

        public HttpLocaleResolutionConfigurationProperties()
    • Method Detail

      • getFixed

        @NonNull
        public java.util.Optional<java.util.Locale> getFixed()
        Specified by:
        getFixed in interface io.micronaut.core.util.locale.LocaleResolutionConfiguration
        Returns:
        The fixed locale
      • setFixed

        public void setFixed​(@Nullable
                             java.util.Locale fixed)
        Set the language tag for the locale. Supports BCP 47 language tags (e.g. "en-US") and ISO standard (e.g "en_US").
        Parameters:
        fixed - The fixed locale
      • setSessionAttribute

        public void setSessionAttribute​(@Nullable
                                        java.lang.String sessionAttribute)
        Sets the key in the session to look for the locale.
        Parameters:
        sessionAttribute - The session attribute key
      • getDefaultLocale

        @NonNull
        public java.util.Locale getDefaultLocale()
        Specified by:
        getDefaultLocale in interface io.micronaut.core.util.locale.LocaleResolutionConfiguration
        Returns:
        The locale to be used if one cannot be resolved.
      • setDefaultLocale

        public void setDefaultLocale​(@NonNull
                                     java.util.Locale defaultLocale)
        Sets the locale that will be used if the locale cannot be resolved through any means. Defaults to the system default.
        Parameters:
        defaultLocale - The default locale.
      • setCookieName

        public void setCookieName​(@Nullable
                                  java.lang.String cookieName)
        Sets the name of the cookie that is used to store the locale.
        Parameters:
        cookieName - The name of the cookie used to store the locale
      • setHeader

        public void setHeader​(boolean header)
        Set to true if the locale should be resolved from the `Accept-Language` header. Default value (true).
        Parameters:
        header - Header resolution