title: How to ensure that child class will call the correct super constructor in lombok?
body: <p>Say that I have the following classes</p>
  
  <pre><code>@AllArgsConstructor
  @NoArgsConstructor
  @Data
  @Builder
  public class A {
  
      private String item1;
      private String item2;
      private String item3;
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>@Data
  public class B extends A {
  
      private String item4;
  
      @Builder(builderMethodName = "bBuilder")
      public B(String item1, String item2, String item3, String item4) {
          super(item1, item2, item3);
          this.item4 = item4;
      }
  }
  </code></pre>
  
  <p>how can I (or is there even a way) to guarantee that the child constructor will call the "correct" constructor when I call the super constructor? More specifically, I want to 100% ensure that the three string values I pass in indeed are set to the correct fields in the parent, and not something where, say, item1 in is set to item2.</p>
  
  <p>I know that I could, for example either:</p>
  
  <ul>
  <li>explicitly create my own all args constructor</li>
  <li>in the child constructor, call all of the setters of the parent</li>
  </ul>
  
  <p>but I am just curious if Lombok is smart enough, somehow, to set the the fields in the child class to the correct ones in the parent class?</p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>I know that the order of the fields determine the order of the fields of the constructor, but that to me isn't safe enough, since if someone inserts a new field, say in the middle, then it will throw everything off.</p>
  
  <p>However, perhaps the @SuperBuilder might be something that I could use, as some have suggested, if not, then I will just explicit create my own constructor to guarantee the order of fields. </p>