I have a situation where I use a builder pattern for constructing an object. Best example to give is the pizza code
public class Pizza { private int size; pr
you can use @Builder(toBuilder = true).
@Builder(toBuilder = true) class Pizza { int val; } Pizza ob = Pizza.builder().val(10)build(); Pizza newObj = ob.toBuilder().val(11).build();
Ref : https://projectlombok.org/features/Builder