Hello I have the following class structure -
@Getter
@SuperBuilder(toBuilder = true)
@ToString
@NoArgsConstructor
abstract class A {
String a;
}
@Getter
@SuperBuilder(toBuilder = true)
@ToString
@AllArgsConstructor
class B extends A {
String b;
}
public A setAField(final A aObj, final String setA) {
return aObj.toBuilder().a(setA).build();
}
The IDE is showing error as its not able to find the toBuilder() method. Do I need to cast to concrete before calling the toBuilder()?