1.根据配置文件的属性创建一个bean实体类
server:
port: 8081
person:
name: boot
age: 18
date: 2019/04/22
maps: {k1: v1,k2: v2}
list: [e1,e2,e3]
animal:
name: dog
age: 3
Person 实体类;
package com.myproject.springboot.bean;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class Person {
private String name;
private Integer age;
private Date birth;
private Map<String,Object> maps;
private List<Object> list;
private Animal animal;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Date getBirth() {
return birth;
}
public void setBirth(Date birth) {
this.birth = birth;
}