Hi,
I have a structure like:
class Source {
val field1: ...
val field2: ...
val otherField: ...
}
class Destination {
val singleField: TargetField
val otherField: ...
}
I'd like to create a mapping from (field1 + field2) to singleField (keeping btw otherField).
I can easily create a Transformer to handle this:
class MyTransformer : MappingTransformer<Source, TargetField> {
but I cannot declare the mapping using this transformer, then:
.withMapping<Source, Destination> {
Source::Source mappedTo Destination::otherField
??? mappedTo Destination::singleField withTransformer MyTransformer::class
}
This is probably not the right way to achieve my goal. How could do?
(I guess I could also use a Decorator but then my singleField should be declared as a var which is not acceptable in my case)
Hi,
I have a structure like:
I'd like to create a mapping from (
field1+field2) tosingleField(keeping btwotherField).I can easily create a Transformer to handle this:
but I cannot declare the mapping using this transformer, then:
This is probably not the right way to achieve my goal. How could do?
(I guess I could also use a Decorator but then my
singleFieldshould be declared as avarwhich is not acceptable in my case)