be.idamf.sofa.mapper
Class AbstractMapper<A,B>

java.lang.Object
  extended by be.idamf.sofa.mapper.AbstractMapper<A,B>
Type Parameters:
A - object type A
B - object type B
All Implemented Interfaces:
Mapper<A,B>
Direct Known Subclasses:
AbstractBidirectionalMapper

public abstract class AbstractMapper<A,B>
extends Object
implements Mapper<A,B>

Abstract mapper class, implementing the Mapper.mapCollectionOfAToCollectionOfB(java.util.Collection, java.util.Collection) method by just iterating the list and calling the Mapper.mapAToB(Object).


Constructor Summary
AbstractMapper()
           
 
Method Summary
<C extends Collection<B>>
C
mapCollectionOfAToCollectionOfB(Collection<A> collectionOfA, C emptyMutableCollectionOfB)
          Map a collection of objects of type A to a collection of objects of type B.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface be.idamf.sofa.mapper.Mapper
mapAToB
 

Constructor Detail

AbstractMapper

public AbstractMapper()
Method Detail

mapCollectionOfAToCollectionOfB

public <C extends Collection<B>> C mapCollectionOfAToCollectionOfB(Collection<A> collectionOfA,
                                                                   C emptyMutableCollectionOfB)
Map a collection of objects of type A to a collection of objects of type B.

Specified by:
mapCollectionOfAToCollectionOfB in interface Mapper<A,B>
Type Parameters:
C - The type of the resulting collection
Parameters:
collectionOfA - the collection of objects of type A
emptyMutableCollectionOfB - an instance of the collection of objects of type B, which will be filled up
Returns:
a collection of objects of type B


Copyright © 2013 iDA-MediaFoundry. All Rights Reserved.