I want to create an abstract class to be able to convert entities into dto and dto into entities with the modelmapper library. What am I doing wrong?
public abstract class AbstractConverter<Entity,DTO> {
@Autowired
ModelMapper modelMapper;
public Entity toEntity(DTO dto) {
return modelMapper.map(dto, Entity.class);
}
}
This is the error
Illegal class literal for the type parameter Entity