Yaml
Channel: info: -channel-ip:192.168.1.40 channel-no:5182001001 -channel-ip:192.168.1.10 channel-no:5182000002 -channel-ip:192.168.1.30 channel-no:5182001003 -channel-ip:192.168.1.20 channel-no:5182000004
JavaBean: 2, not in the form of an inner class
@Component @order (value = 1) @ConfigurationProperties (prefix = "channel") @JsonNaming ( PropertyNamingStrategy.SnakeCaseStrategy.class) public class Channelproperties { private list< channelinfopreperties> info = new arraylist<> (); Public list<channelinfopreperties> GetInfo () { return info; } public void SetInfo (list<channelinfopreperties> info) { this.info = info; }}
@Component @order (value = 1) @ConfigurationProperties (prefix = "Channel.info") @JsonNaming ( PropertyNamingStrategy.SnakeCaseStrategy.class) public class Channelinfopreperties { private String channelip; Private String Channelno; Public String Getchannelip () { return channelip; } public void Setchannelip (String channelip) { this.channelip = channelip; } Public String Getchannelno () { return channelno; } public void Setchannelno (String channelno) { this.channelno = Channelno; }}
Yaml Spring Boot Two-dimensional array notation