springboot-yml内list、map组合写法

yml:
myProps:
varmaplist:
key11:
- t1
- t2
- t3
key22:
- t11
- t22
- t33
list:
- topic1
- topic2
- topic3
maps: {key1: 'value1', key2: 'value2'}
MyProps:
@Component
@Data
@Configuration
@PropertySource(value = {"classpath:/bootstrap.yml"}, encoding = "utf-8")
@ConfigurationProperties(prefix = "myProps")
public class MyProps {

private List<String> list;


private Map<String,String> maps;

private Map<String,List<String>> varmaplist;
}
 
posted @ 2019-04-29 15:15  carjayal  阅读(41175)  评论(0编辑  收藏  举报