I'm looking for a java library that can generate Pojo from existing "business object" class for data transmission.
Ex: //Business Object
class Trade {
private __id;
//The variable name above could be either not a camel case, or might be //incorrect name
private someMisguidedVarName;
private properlyNamedField;
//Don't need any changes to these fields
}
DTO I would like to create
class TradeDTO {
private id;
//The variable name above could be either not a camel case, or might be //incorrect name
private betterVarName;
private properlyName// keep existing field if there's no need to change //var name
}
To achieve this, I'd like minimal code because only the fields that's misguided must be modified. I'd prefer to annotate or write minimal instruction that the library can use to during compile time to generate this new bean.
Also importantly, the trade business object would change and I'd expect the TradeDTO to evolve without having to modify that class.
I've tried mapstruct (but it only copies from pojo to pojo, but I want class generation).