title: Spring-boot: set default value to configurable properties
body: <p>I have a properties class below in my spring-boot project.</p>
  
  <pre><code>@Component
  @ConfigurationProperties(prefix = "myprefix")
  public class MyProperties {
      private String property1;
      private String property2;
  
      // getter/setter
  }
  </code></pre>
  
  <p>Now, I want to set default value to some other property in my application.properties file for <code>property1</code>. Similar to what below example does using @Value</p>
  
  <pre><code>@Value("${myprefix.property1:${somepropety}}")
  private String property1;
  </code></pre>
  
  <p>I know we can assign static value just like in example below where "default value" is assigned as default value for <code>property</code>,</p>
  
  <pre><code>@Component
  @ConfigurationProperties(prefix = "myprefix")
  public class MyProperties {
      private String property1 = "default value"; // if it's static value
      private String property2;
  
      // getter/setter
  }
  </code></pre>
  
  <p>How to do this using @ConfigurationProperties class (rather typesafe configuration properties) in spring boot where my default value is another property ?</p>