Class MapCollectionHandler

java.lang.Object
io.beanmapper.core.collections.AbstractCollectionHandler<Map>
io.beanmapper.core.collections.MapCollectionHandler
All Implemented Interfaces:
CollectionHandler<Map>

public class MapCollectionHandler extends AbstractCollectionHandler<Map>
  • Constructor Details

    • MapCollectionHandler

      public MapCollectionHandler()
  • Method Details

    • copy

      public Map copy(BeanMapper beanMapper, Class collectionElementClass, Map source, Map target)
      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 items
      collectionElementClass - the class of an item within the target collection
      source - the source collection of items
      target - the target collection where the mapped source items will end up
      Returns:
      the target collection
    • size

      public int size(Map targetCollection)
    • clear

      protected void clear(Map target)
      Description copied from class: AbstractCollectionHandler
      Calls the clear method on the target collection
      Specified by:
      clear in class AbstractCollectionHandler<Map>
      Parameters:
      target - the collection to call clear() on
    • create

      protected Map create()
      Description copied from class: AbstractCollectionHandler
      Creates a new instance of the collection class
      Specified by:
      create in class AbstractCollectionHandler<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 interface CollectionHandler<Map>
      Overrides:
      getGenericParameterIndex in class AbstractCollectionHandler<Map>
      Returns:
      the index of the generic parameter type of the map value