Suppose I have any given number of POJOs that all share common, identically named properties. Ideally I'd like to avoid a large interface with multiple mappers defined like
DtoA fromBToA(DtoB dtoB)
DtoB fromAToB(DtoA dtoA)
DtoC fromAToC(DtoA dtoA)
for each of the many POJOs I'll be dealing with.
Is it possible to define an interface which will accept any object and return any object? I tried
Object genericMapper(Object object)
This obviously doesn't work because it can't access the properties to generate the code.
I suppose since MapStruct documentation states:
This implementation uses plain Java method invocations for mapping between source and target objects, i.e. no reflection or similar.
what I'm requesting isn't possible, but I just thought I'd get closure or if there are any workarounds available.