title: Convert Yaml file to java objects
body: <p>I have the Yaml File like below</p>
  <pre><code>Network:
     Input 1:
        - profile : &quot;1&quot;
        - size: 2
     Input 2:
        - profile : &quot;1&quot;
        - size: 3
     Input 1:
        - profile :&quot;2&quot;
        - size:100
     Input 2:
        - name :&quot;N&quot;
        - source: &quot;test&quot;
  </code></pre>
  <p>and am using the below dependency to convert it to class objects</p>
  <pre><code>import com.fasterxml.jackson.databind.ObjectMapper;
  import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
  
  
  ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
  Tiles tiles = mapper.readValue(new File(args[0]), Tiles.class);
  </code></pre>
  <p>My Tiles class is like below</p>
  <pre><code>    public class Tiles {
      
        @JsonProperty
        private Network network;
        public Network getNetwork() {
          return network;
        }
        public void setNetwork(Network network) {
          this.network = network;
        }
        }
  public class Network {
  
    public Network() {
      super();
    }
  
    @JsonProperty
    private List&lt;String&gt; input;
  
    public List&lt;String&gt; getInput() {
      return input;
    }
  
    public void setInput(List&lt;String&gt; input) {
      this.input= input;
    }
  </code></pre>
  <p>but when parsing the YAML file using <code>ObjectMapper</code> I get an exception, e.g.     <code>com.fasterxml.jackson.databind.JsonMappingException:</code></p>
  <p>I want to process the YAML file sequentially even though the Input is replaced by different names, I mean
  I have to get Input 1 then Input 2 then so on</p>
  <p>any help is appreciated.</p>
  <p>Thanks in advance</p>