public interface CollectionHandler<C>
Modifier and Type | Method and Description |
---|---|
C |
copy(BeanMapper beanMapper,
Class collectionElementClass,
C source,
C target)
Takes all the content from source and offers it to target.
|
Class<?> |
determineGenericParameterFromType(ParameterizedType type) |
C |
getTargetCollection(BeanCollectionUsage collectionUsage,
Class<C> preferredCollectionClass,
Class<?> collectionElementClass,
C targetCollection,
CollectionFlusher collectionFlusher,
Boolean flushAfterClear)
Retrieves either the target collection or creates a new collection instance.
|
Class<C> |
getType()
The type of the collection class.
|
boolean |
isMatch(Class<?> clazz)
Check if the sourceClass contains the matching class somewhere in its
hierarchy
|
int |
size(C targetCollection) |
C copy(BeanMapper beanMapper, Class collectionElementClass, C source, C target)
beanMapper
- the beanmapper to use for mapping the individual itemscollectionElementClass
- the class of an item within the target collectionsource
- the source collection of itemstarget
- the target collection where the mapped source items will end upC getTargetCollection(BeanCollectionUsage collectionUsage, Class<C> preferredCollectionClass, Class<?> collectionElementClass, C targetCollection, CollectionFlusher collectionFlusher, Boolean flushAfterClear)
collectionUsage
- the type of collection usage to applypreferredCollectionClass
- the class type of the target collectioncollectionElementClass
- the class type of an element within the target collectiontargetCollection
- the actual target collectioncollectionFlusher
- the flusher to call after clear has been called on a filled
collectionflushAfterClear
- whether flush must be called after clear on a collection has been
calledClass<C> getType()
boolean isMatch(Class<?> clazz)
clazz
- the class to check for the typeint size(C targetCollection)
Class<?> determineGenericParameterFromType(ParameterizedType type)
Copyright © 2015–2018 42 BV. All rights reserved.