modelmapper skip field in ArrayList

Viewed 18

hi i am using modelmapper 3.1.0 to transform met bean to dto. I have a case where I have beans that have such a defined field

private List<TwoDto> list = new ArrayList<>();

in TwoDto I want to exclude the id field. I defined

TypeMap<TwoBean, TwoDto> typeMap = modelMapper.createTypeMap(TwoBean.class, TwoDto.class, "lazy");
        typeMap.addMappings(new PropertyMap<>() {
            @Override
            protected void configure() {
                skip(destination.getList().get(0).getId());
            }
        });

when I run the program i recive

Invalid destination method java.util.List.get(). Ensure that method has one parameter and returns void.

how do i do to map the skip of a field in a list?

Thanks

Sergio

0 Answers
Related