bpep icon indicating copy to clipboard operation
bpep copied to clipboard

Feature: option to generate separate java file (interacting with setter methods of original)

Open typekpb opened this issue 9 years ago • 0 comments

I'd love to use have an option for: [X] Generate Separate file (*Builder.java)

Which would possibly check visibility of fields/availability of setters and show only fields visible in the same package via another class.

Generating for:

public class Foo {
   private int bar;

   void setBar(Bar bar) {
   ...
   }
}

Following:

public class FooBuilder {
   private Foo foo;

   public FooBuilder() {}

   public FooBuilder setBar(Bar bar) {
      this.foo.setBar(bar);
      return this;
   }

   public build() {
     return this.foo;
   }
}

typekpb avatar Aug 17 '16 08:08 typekpb