码迷,mamicode.com
首页 > 编程语言 > 详细

springboot-yml内list、map组合写法

时间:2019-04-29 16:02:28      阅读:2083      评论:0      收藏:0      [点我收藏+]

标签:config   nbsp   top   rop   utf-8   ati   bootstrap   efi   ref   

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;
}
 

springboot-yml内list、map组合写法

标签:config   nbsp   top   rop   utf-8   ati   bootstrap   efi   ref   

原文地址:https://www.cnblogs.com/neaos/p/10790528.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!