Answers for "modelmapper abstract class"

0

modelmapper abstract class

public void configure(ModelMapper modelMapper) {
    modelMapper.typeMap(QuestionDto.class, AbstractItem.class)
            .setConverter(converterWithDestinationSupplier(Question::new));
    modelMapper.typeMap(CriteriaDto.class, AbstractItem.class)
            .setConverter(converterWithDestinationSupplier(Criteria::new));
}

private <S, D> Converter<S, D> converterWithDestinationSupplier(Supplier<? extends D> supplier ) {
    return ctx -> ctx.getMappingEngine().map(ctx.create(ctx.getSource(), supplier.get()));
}
Posted by: Guest on April-09-2021

Code answers related to "modelmapper abstract class"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language