Skip to content

Map to collection of targets #46

@jeroenvs

Description

@jeroenvs

Sometimes you want to map a collection of sources into a collection of existing targets, e.g:

Collection forms = ...;
Collection entities = repository.findAll();
Collection results = beanMapper.map(forms, entities);

This would automatically select the comparable (equal) entity from the target list and map the source.

To compare entities an 'Equalizer' interface has to be created:
boolean equals(Object left, Object right)

With a default implementation that does an Object.equals(left, right), this is by default null safe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions