Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Latest commit

 

History

History
33 lines (26 loc) · 564 Bytes

README.md

File metadata and controls

33 lines (26 loc) · 564 Bytes

BuilderGenerator

Automatically generate Builder classes that allow chaining instead of calling every single setter by itself, all through the magic of Maven.

MyDto dto = new MyDto();
dto.setA("a");
dto.setB(2);

MyOtherDto dto2 = new MyOtherDto();
dto2.setSomething(new Object());

dto.setDto(dto2);

list.add(dto);

becomes

list.add(
  MyDtoBuilder.aMyDtoBuilder()
    .withA("a")
    .withB(2)
    .withDto(
      MyOtherDtoBuilder.aMyOtherDtoBuilder()
      .withSomething(new Object())
      .build()
    )
    .build();
);