title: Spring boot properties to object
body: <p>I have the following config</p>
  
  <pre><code>job:
    x:
      cron: 0 0 0 1,16 * ?
      group: xg
      name: xn
    y:
      cron: 0 0 1 1,16 * ?
      group: yg
      name: yn
  </code></pre>
  
  <p>and a JAVA POJO like this</p>
  
  <pre><code>public class JobConfigProperties {
      private String group;
      private String name;
      private String cron;
      ...
  }
  </code></pre>
  
  <blockquote>
    <p>I am looking for a way to let spring boot populate those classes</p>
    
    <p>@LoadPropertiesAsObject(prefix="job.x") private JobConfigProperties
    jobXConfig; @LoadPropertiesAsObject(prefix="job.y") private
    JobConfigProperties jobYConfig;</p>
  </blockquote>
  
  <p><code>@ConfigurationProperties</code> is not working because it must be attached to a class or a method</p>
  
  <p>Later edit: it seems that <code>@ConfigurationProperties</code> can be applied on a method. I will give it a try and come back with the result.</p>