You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use @SuperBuilder() in 2 class, I want override method build() of class child builder but it appear error "Abstract method 'build()' cannot be accessed directly" in super.build() in ClassChild
Version Lombok: 1.18.28
Version java: 17
ClassChild.java
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class ClassChild extends ClassParent {
private int age;
public static ClassChildBuilder builder() {
return new BuilderCustom();
}
public static class BuilderCustom extends ClassChildBuilder {
public ClassChild build() {
ClassChild classChild = super.build();
return classChild;
}
@Override
protected ClassChildBuilder self() {
return this;
}
}
}
ClassParent.java
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Data
public class ClassParent {
private String name;
}
Manually implementing any of @SuperBuilder's code is tricky and you should really know what you are doing.
At least start with the delombok'ed code. Otherwise you'll be totally lost without the exact type parameters.
BTW: This is not a bug, this is a usage question better asked at StackOverflow.
Manually implementing any of @SuperBuilder's code is tricky and you should really know what you are doing. At least start with the delombok'ed code. Otherwise you'll be totally lost without the exact type parameters.
BTW: This is not a bug, this is a usage question better asked at StackOverflow.
I want override to process continue logic in build(), it will auto check, client don't need care about it when create object by builder.
Hi, Lombok team and people.
I use @SuperBuilder() in 2 class, I want override method build() of class child builder but it appear error "Abstract method 'build()' cannot be accessed directly" in super.build() in ClassChild
Version Lombok: 1.18.28
Version java: 17
ClassChild.java
ClassParent.java
Main class
How should I fix to override the build() method success?
The text was updated successfully, but these errors were encountered: