package kr.pe.elex.examples;

import org.modelmapper.ModelMapper;

public class Example {
	public static void main(String... args){
		User alice = User.builder()
				.id(100).age(34)
				.name("Alice")
				.address(Address.builder().city("Emerald City").street("Main Street")
						.build())
				.build();

		ModelMapper modelMapper = new ModelMapper();
		modelMapper.getConfiguration().setSkipNullEnabled(true);

		UserDto userDto =modelMapper.map(alice, UserDto.class);

		System.out.println(userDto.toString());

		User2Dto user2Dto = modelMapper.map(alice, User2Dto.class);
		System.out.println(user2Dto.toString());
	}
}
