title: SnakeYaml Deserialise Class containing a List of Objects
body: <p>I'm trying to use snakeyaml to deserilise the below YAML into the domain model below, however I keep getting java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to ConfigurableThing. </p>
  
  <p>Note I am able to successfully deserialise a single ConfigurableThing, it's only when trying to deserialise the list of ConfigurableThings that I run into issues.</p>
  
  <p><strong>Code to deserialise</strong></p>
  
  <pre><code>File file = new File(classLoader.getResource("config.yml").getFile());
  
          try(InputStream in = new FileInputStream(file)){
              Yaml yaml = new Yaml();
              Configuration config = yaml.loadAs(in,Configuration.class);
          }
  </code></pre>
  
  <p><strong>YAML</strong></p>
  
  <pre><code>things:
   - type: TYPE1
     name: foo
     value: 2.00
   - type: TYPE2
     name: bar
     value 8.00
  </code></pre>
  
  <p><strong>Model</strong></p>
  
  <pre><code>public final class Config {
  
      private List&lt;ConfigurableThing&gt; things;
  
      //Getter and Setter
  
  }
  
  public final class ConfigurableThing {
  
      private Type type;
  
      private String name;
  
      private BigDecimal value;
  
      //Getters and Setters
  }
  
  public enum Type {
      TYPE1,TYPE2
  }
  </code></pre>