Class RoutesVersioningConfiguration

  • All Implemented Interfaces:
    io.micronaut.core.util.Toggleable

    @ConfigurationProperties("micronaut.router.versioning")
    @Requires(property="micronaut.router.versioning.enabled",
              value="true")
    public class RoutesVersioningConfiguration
    extends java.lang.Object
    implements io.micronaut.core.util.Toggleable
    Routes versioning configuration.
    Since:
    1.1.0
    • Field Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> getDefaultVersion()  
      boolean isEnabled()  
      void setDefaultVersion​(java.lang.String defaultVersion)
      Sets the version to use if the version cannot be resolved.
      void setEnabled​(boolean enabled)  
      • Methods inherited from class java.lang.Object

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

      • PREFIX

        public static final java.lang.String PREFIX
        The configuration property.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RoutesVersioningConfiguration

        public RoutesVersioningConfiguration()
    • Method Detail

      • setEnabled

        public void setEnabled​(boolean enabled)
        Parameters:
        enabled - Enables the version based route matches filtering.
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface io.micronaut.core.util.Toggleable
        Returns:
        true if version based matches filtering is enabled.
      • getDefaultVersion

        public java.util.Optional<java.lang.String> getDefaultVersion()
        Returns:
        The version to use if none can be resolved
      • setDefaultVersion

        public void setDefaultVersion​(@Nullable
                                      java.lang.String defaultVersion)
        Sets the version to use if the version cannot be resolved. Default value (null).
        Parameters:
        defaultVersion - The default version