title: Trouble with Spring @ConfiurationProperties extending Mao
body: <p>I am trying to load come properties from config using the Spring @Configuration &amp; @ConfigurationProperties combination. I have a POJO that extends HashMap&lt;Integer, String&gt; and has a single variable inside. (See <code>MyConfigPojo</code> below).  From the .yaml file, I have the same shape. However, when booting up the app, I get an error when trying to parse the string for the defaultValue into an Integer.</p>
  <pre><code>@Configuration
  @ConfigurationPropeties(prefix = &quot;my-config&quot;)
  public class MyConfigPojo extends HashMap&lt;Integer, String&gt; {
  
    private String defaultValue;
  
    private String getValueForIdOrDefault(int id); // this.get(id) OR ELSE defaultValue
  }
  </code></pre>
  <p>In config I have this:</p>
  <pre><code>myConfig:
    1: &quot;my first value&quot;
    23: &quot;my 23rd value&quot;
    defaultValue: &quot;cheese&quot;
  </code></pre>
  <p>Which results in a</p>
  <pre><code>APPLICATION FAILED TO START
  Description:
  Failed to bind properties under 'myPackage' to MyConfigPojo:
  Property: myConfig[1]
  Value: cheese
  </code></pre>
  <p>I thought that was weird, so I turned on TRACE logs and found this:</p>
  <pre><code>99 common frames omittedCaused by: java.lang.NumberFormatException: For input string: &quot;defaultValue&quot; at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
  </code></pre>
  <p>Is there a way to intercept reading this file or to tell Spring how to set the values properly?</p>