i want to map values between a yaml file with a Map<String, List<String>>
in springboot
country.yml
file:
entries:
map:
MY:
- en
- zh
SampleConfig
file:
@Configuration
@EnableConfigurationProperties
@ConfigurationProperties("entries")
public class SampleConfig {
private Map<String, List<String>> map = new HashMap<>();
@Bean
public void bean1(){
System.err.println("map has size: "+map.size());
}
}
But the map.size()
is always 0, not sure what i do wrong.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…