publicissapient-france/selma

Intercept final result

naarl opened this issue · 0 comments

naarl commented

Hi !

It would be nice to have the ability to intercept the final result of a mapping in order to apply some post mapping logics.

For example :

@Maps(withCustoms = {MyInterceptor.class})
DTO asDTO(Entity in)

class MyInterceptor {
    DTO intercept(Entity in, DTO out) {
        // Do some post mapping treatment, as conditionnal field aggregation for example
        return out;
    }
}