SpringBoot的@ConfigurationProperties是否可以拥有不可变(最终)字段?注解?下面的例子@ConfigurationProperties(prefix="example")publicfinalclassMyProps{privatefinalStringneededProperty;publicMyProps(StringneededProperty){this.neededProperty=neededProperty;}publicStringgetNeededProperty(){..}}到目前为止我尝试过的方法:创建@Bean的MyProps具有
SpringBoot的@ConfigurationProperties是否可以拥有不可变(最终)字段?注解?下面的例子@ConfigurationProperties(prefix="example")publicfinalclassMyProps{privatefinalStringneededProperty;publicMyProps(StringneededProperty){this.neededProperty=neededProperty;}publicStringgetNeededProperty(){..}}到目前为止我尝试过的方法:创建@Bean的MyProps具有