Yaml Spring Boot Two-dimensional array notation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.