How to map List to List with Dozer? -


I have a service that returns the list , say, A B objects in List

I have defined mapping from a . To b .

Nazi, I tried to

  list & lt; A & gt; Ayes = ... // List of services to call & lt; B & gt; Bees = DodgerMapMap (Enz, New Arriylist & lt; B & gt; (.) GetClass ());   

However, bees still have a list of A objects.

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. 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 destination class) mapping {return baseMapper.map (source, destination class); } Public throws a Zero map (Object Source, Object Destination, String Map Id) Mapping Explanation {baseMapper.map (source, destination, map id); } Public Zero Maps (Object Source, Object Destination) Mapping Upption throws {Besamappar.Map (source, destination); }}

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -