How to define a map in a YAML file for simple POJO?

后端 未结 2 1012
不思量自难忘°
不思量自难忘° 2021-02-03 18:58

I am using snakeYaml to parse certain configuration/property values to a Configuration object.

My yaml file looks like this -

#Thread
batchLimit: 1000
th         


        
2条回答
  •  无人及你
    2021-02-03 19:40

    Here is how it can look like:

    #MAP
    keyMapping: 
        key1: value1
        key2: value2
    

    Generally YAML format has natural support of key-value pairs. Take a look on the following tutorial (just for example): https://github.com/Animosity/CraftIRC/wiki/Complete-idiot's-introduction-to-yaml

    Or just google "yaml map" for more details.

提交回复
热议问题