How to map List to List with Dozer? -
I have a service that returns the I have defined mapping from Nazi, I tried to However, What should I do? I think you can get it in Dosage using signals, but we found the default A wrapper around the mapper is easy. An example is below then you can trust only the default client converters / mapers that you have defined for mapping. list , say,
A B objects in
List
a . To
b .
list & lt; A & gt; Ayes = ... // List of services to call & lt; B & gt; Bees = DodgerMapMap (Enz, New Arriylist & lt; B & gt; (.) GetClass ());
bees still have a
list of
A objects.
CollectionMapperDecorator custom = New CollectionMapperDecorator (dozerMapper); Collection & lt; P & gt; Bees = Custom. Maple (Aya, Beaclas); Public Class CollectionMapDicroctor Mapper {Private Mapper Basemapper; Public CollectionModerDecoder (Mapper Basemapper) {this.baseMapper = baseMapper; } Public & lt; T & gt; Collections & lt; T & gt; MapCollection (object [] source, class & lt; T & gt; destination class) {return maps collection (arrays.asList (source), destinationClass); } Public & lt; T & gt; Collections & lt; T & gt; MapCollection (Object [] source, collection & lt; T & gt; destination, class & lt; T & gt; destination class) {Back to mapCollection (arrays.asList (source), destination, destination class); } Public & lt; T & gt; Collections & lt; T & gt; MapCollection (collection & lt;; Object & gt; source, class & lt; T & gt; provides destination class) {return map compilation (source, empty, destination class); } Public & lt; T & gt; Collections & lt; T & gt; MapCollection (collection & lt; Object & gt; source, archive & lt; T & gt; destination, class & lt; T & gt; destination class expands) {if (destination == null) destination = new ArrayList & lt; T & gt; (); (Object source obj: Source) {destination.add (map (sourceObj, destinationClass)); } Return destination; } Public & lt; T & gt; Throws the map map (Object Source, Class & lt; T & gt; Destination class, string map id), mapping {return baseMapper.map (source, destination class, map id); } Public & lt; T & gt; Throws the map map (object source, class
Comments
Post a Comment