title: Why setters are mandatory for fields in a class which reads properties from application.yml file in springboot?
body: <p>Following is my code:</p>
  <p>Why setter is mandatory. Without it, the class does not
  read the property from the
  application.yml file
  correctly.</p>
  <p>Thank you.</p>
  <pre><code>@Getter
  @Setter
  @NoArgsConstructor
  @Configuration
  @ConfigurationProperties(prefix = &quot;test&quot;)
  @EnableConfigurationProperties
  public class KafkaTopicConfig {
  
      private String bootstrapAddress;
  
      @Value(value = &quot;${test.bootstrapAddress}&quot;)
      private String bootstrapAddressFromVariable;
  </code></pre>