yaml

阅读 52

2022-02-18


yaml

environments:
dev:
url: https://dev.example.com
name: Developer Setup
prod:
url: https://another.example.com
name: My Cool App


properties:

environments.dev.url=https://dev.example.com
environments.dev.name=Developer Setup
environments.prod.url=https://another.example.com
environments.prod.name=My Cool App


yaml数组

my:
servers:
- dev.example.com
- another.example.com

properties数组

my.servers[0]=dev.example.com
my.servers[1]=another.example.com


java配置对象

@ConfigurationProperties(prefix="my")
public class Config {

private List<String> servers = new ArrayList<String>();

public List<String> getServers() {
return this.servers;
}
}

 

精彩评论(0)

0 0 举报