I have a simple problem. I have a large class:
public class Base {
public Field1Data field1;
public Field2Data field2;
public Field3Data field3;
// many more fields later...
public Field1234Data field1234;
}
It has a very large number of fields, with a very large number of types.
Then I have an extension:
public class UpgradedBase extends Base {
public String metadata;
}
I want a concise way to write the following method:
public static UpgradedBase upgrade(Base baseInstance, String metadata){
/// What I don't know how to write.
}
I have Lombok, but that’s about it as far as code-gen tools go.
How can I write the upgrade
method above? I’d prefer a concise method.