Use constructor injection for spring ConfigurationProperties subclasses
问题 I was looking at this https://www.baeldung.com/configuration-properties-in-spring-boot and was wondering if it was possible to use constructor injection for these in order to enforce some immutability properties. For example would it be possible to do this: @Component @ConfigurationProperties("my-config") public class MyConfig { private final List<String> values; public MyConfig(@Value("${values}") List<String> values) { this.values = ImmutableList.copyOf(values); } } And then in my yml