Annotation Type Builder.Constructor


  • @Documented
    @Target(CONSTRUCTOR)
    public static @interface Builder.Constructor
    The same as Builder.Factory, but for constructors rather than static methods.
     class Sum {
       final int result;
     
       @Builder.Constructor
       Sum(int a, int b) {
          this.result = a + b;
       }
     }
     ... // use generated builder
     Sum sum = new SumBuilder()
        .a(111)
        .b(222)
        .build();
     

    Class level and package level style annotations fully supported (see Value.Style).