Search code examples
javaannotationsmicronaut

Micronaut @Requires default declaration


Are @Requires("environment") and @Requires(env = "environment") equivalent?

In case they're not, which is the behavior of the default declaration of @Requires?


Solution

  • The default (no name specified) argument of an annotation is always the parameter named value. So no, they are not equivalent. These are:

    @Requires("environment")
    @Requires(value = "environment")