Let's say i have the following classes
class User {
private String name:
private Address address;
// getters and setters
}
class UserDto {
private String name:
private Address address;
// getters and setters
}
I already have created a modelMapper that allows me to do the following :
UserDto userDto = modelMapper.map(user, UserDto.class); // this map function map every field in the User class to UserDto class
And i would like to create a modelMapper that allows me to do the following :
UserDto userDto = modelMapper.mapWithoutAddress(user, UserDto.class); // this map function map every field except the adress from the User class to UserDto class
NB: i'am using a ModelMapper Singleton, i'm using the same instance in all my application.