Je souhaite exclure certains champs lors du mappage d'un bean vers HashMap
.Comment exclure le champ dans le mappeur de haricots Orika?
définition Orika:
static {
final MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
mapperFactory.classMap(MyReq.class, Map.class)
.exclude("myproperty")
.byDefault()
.register();
MAPPER = mapperFactory.getMapperFacade();
}
définitions Bean:
public class MyReq {
private String myproperty;
}
Utilisation:
MyReq req = new MyReq;
Map map = MAPPER.map(req, Map.class);
Résultat: le Map
contient le champ myproperty
exclu! Pourquoi?