net.sf.seaf.util.convert.collection
Class CollectionConverter<Source,Target>

java.lang.Object
  extended by net.sf.seaf.util.convert.collection.CollectionConverter<Source,Target>

public class CollectionConverter<Source,Target>
extends Object

Converts a Collection of objects of type Source to a Collection of objects of type Target.


Constructor Summary
CollectionConverter()
           
 
Method Summary
 Collection<Target> convert(Collection<Source> sourceCollection, Collection<Target> targetCollection, ObjectConverter<Source,Target> objectConverter)
          Converts a Collection of objects of type Source to a Collection of objects of type Target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionConverter

public CollectionConverter()
Method Detail

convert

public Collection<Target> convert(Collection<Source> sourceCollection,
                                  Collection<Target> targetCollection,
                                  ObjectConverter<Source,Target> objectConverter)
Converts a Collection of objects of type Source to a Collection of objects of type Target. Each Source object is converted to an object of type Target using the supplied ObjectConvertor. The supplied Target Collection is cleared first.

Parameters:
sourceCollection - The collection of the Source objects
targetCollection - The collection of the Target objects
objectConverter - An ObjectConvertor to convert each Source to a Target
Returns:
Collection<Target> A collection of Target objects


Copyright © 2008-2011 SEAF. All Rights Reserved.