yaml-文件基本配置
作者:快盘下载 人气:yaml 文件
Person:
name: zzy
age: 5
sex: 男性
user:
name: hello
ID: idiididid
Project:
cat : cat
dog: dog
list:
- 1
- 2
- 3
map: {k1: v1,k2: v2}
date: 2019/9/41
int: ${random.int}
;Component
;ConfigurationProperties(prefix = ;project;) //必须小写 不管yaml中大写还是小写
public class Project {
private String cat;
private String dog;
private List<Integer> list;
private Map<String,String> map;
private Date date;
public List<Integer> getList() {
return list;
}
public void setList(List<Integer> list) {
this.list = list;
}
public Project(String cat, String dog) {
this.cat = cat;
this.dog = dog;
}
public Project(){}
public String getCat() {
return cat;
}
public void setCat(String cat) {
this.cat = cat;
}
public String getDog() {
return dog;
}
public void setDog(String dog) {
this.dog = dog;
}
public Map<String, String> getMap() {
return map;
}
public void setMap(Map<String, String> map) {
this.map = map;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
;Override
public String toString() {
return ;Project{; ;
;cat=;; ; cat ; ;;; ;
;, dog=;; ; dog ; ;;; ;
;, list=; ; list ;
;, map=; ; map ;
;, date=; ; date ;
;};;
}
}
加载全部内容