I want to have the following:
User UserDto UserMapper
userDto = userMapper.map(user);
user = userMapper.map(userDto);
My idea is to have a class similar to this:
public interface EntityMapper<E, D> {
E map(D dto);
D map(E entity);
}
but i am getting the following error:
'map(D)' clashes with 'map(E)'; both methods have same erasure
How can i achieve this without having 2 functions to map?