Micronaut @Requires默认声明

huangapple go评论77阅读模式
英文:

Micronaut @Requires default declaration

问题

@Requires("environment")@Requires(env = "environment") 等效吗?

如果它们不等效,@Requires的默认声明行为是什么

英文:

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

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

答案1

得分: 3

默认情况下(未指定名称的情况下),注释的参数始终是名为 value 的参数。因此,它们不等价。这些是:

@Requires("environment")
@Requires(value = "environment")
英文:

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")

huangapple
  • 本文由 发表于 2023年6月8日 21:46:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76432524.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定