How to map YAML configuration to POJOs with objects of classes
<p>I have the following YAML config</p>

<pre><code>lookupKeys:
  - aggregate_location_city:
    outputKey: city_id
    - file1:
        source: ./pincode_to_city_mapping.csv
        primaryColumn: 0
        secondaryColumn: 1
    - file2:
        source: ./new_geo_city.csv
        primaryColumn: 1
        secondaryColumn: 0
</code></pre>

<p>The corresponding configuration class is</p>

<pre class="lang-java prettyprint-override"><code>@Getter
@Setter
public class Configuration {
    private ArrayList&lt;LookupKey&gt; lookupKeys;

    @Getter
    @Setter
    public class LookupKey{
        private String outputKey;
        private ArrayList&lt;MappingFile&gt; mappingFiles;

        @Getter
        @Setter
        public class MappingFile{
            private String source;
            private int primaryColumn;
            private int secondaryColumn;
        }
    }
}
</code></pre>

<p>How do I get the config file mapped to the Configuration class? I am using snake-yaml for this. A simple <code>yaml.loadAs(in, Configuration.class)</code> is not working.</p>