Package io.beanmapper.core.collections
Class MapCollectionHandler
java.lang.Object
io.beanmapper.core.collections.AbstractCollectionHandler<Map>
io.beanmapper.core.collections.MapCollectionHandler
- All Implemented Interfaces:
CollectionHandler<Map>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Calls the clear method on the target collectioncopy
(BeanMapper beanMapper, Class collectionElementClass, Map source, Map target) Takes all the content from source and offers it to target.protected Map
create()
Creates a new instance of the collection classint
The generic parameter type of the Map value must be determined, not the key.int
Methods inherited from class io.beanmapper.core.collections.AbstractCollectionHandler
create, getTargetCollection, getType, isMatch, mapItem
-
Constructor Details
-
MapCollectionHandler
public MapCollectionHandler()
-
-
Method Details
-
copy
Description copied from interface:CollectionHandler
Takes all the content from source and offers it to target. Every item is handled by BeanMapper before it is stored in target.- Parameters:
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 up- Returns:
- the target collection
-
size
-
clear
Description copied from class:AbstractCollectionHandler
Calls the clear method on the target collection- Specified by:
clear
in classAbstractCollectionHandler<Map>
- Parameters:
target
- the collection to call clear() on
-
create
Description copied from class:AbstractCollectionHandler
Creates a new instance of the collection class- Specified by:
create
in classAbstractCollectionHandler<Map>
- Returns:
- new instance of the collection class
-
getGenericParameterIndex
public int getGenericParameterIndex()The generic parameter type of the Map value must be determined, not the key. Therefore look at index position 1, not 0.- Specified by:
getGenericParameterIndex
in interfaceCollectionHandler<Map>
- Overrides:
getGenericParameterIndex
in classAbstractCollectionHandler<Map>
- Returns:
- the index of the generic parameter type of the map value
-