@Builder(builderMethodName = "mandatoryBuilder")
@ToString
public class MyClass {
private String name;
private String identifier;
public String getName() {
return name;
}
public String getIdentifier() {
return identifier;
}
public static MyClassBuilder builder(String identifier) {
return mandatoryBuilder().identifier(identifier);
}
}
Lombok - mandatory field in builder using builderMethodName
2019-08-24T23:02:00+01:00
GarciaPL
Java|Java 8|Lombok|