Examples of ModelMapper


Examples of org.modelmapper.ModelMapper

    ListWrapper<AccountBo> listWrapperBo = new ListWrapper<AccountBo>();
    listWrapperBo.getEntries().add(accountA);
    listWrapperBo.getEntries().add(accountB);

    ModelMapper modelMapper = new ModelMapper();
    DtoListWrapper wrapper = modelMapper.map(listWrapperBo, DtoListWrapper.class);
    assertEquals(wrapper.getEntries().get(0).getAccountName(), "Person A");
    assertEquals(wrapper.getEntries().get(1).getAccountName(), "Person B");
  }
View Full Code Here

Examples of org.modelmapper.ModelMapper

    protected ProxyConnector getProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
    {
        return proxyConnectorConfiguration == null
            ? null
            : new ModelMapper().map( proxyConnectorConfiguration, ProxyConnector.class );
    }
View Full Code Here

Examples of org.modelmapper.ModelMapper

    private ModelMapper mapperFromDto;
    private ModelMapper mapperFromEntity;

    public ModelMapperListMapper() {
        mapperFromDto = new ModelMapper();
        mapperFromDto.addMappings(new PropertyMap<PersonWithHistoryDTO, Person>() {
            @Override
            protected void configure() {
                map().getName().setFirstname(source.getFirstName());
                map().getName().setSurname(source.getLastName());
            }
        });
        mapperFromEntity = new ModelMapper();
        mapperFromEntity.addMappings(new PropertyMap<Person, PersonWithHistoryDTO>() {
            @Override
            protected void configure() {
                map().setFirstName(source.getName().getFirstname());
                map().setLastName(source.getName().getSurname());
View Full Code Here

Examples of org.modelmapper.ModelMapper

    private ModelMapper mapperFromDto;
    private ModelMapper mapperFromEntity;

    public ModelMapperBasicMapper() {
        mapperFromDto = new ModelMapper();
        mapperFromDto.addMappings(new PropertyMap<PersonDTO, Person>() {
            @Override
            protected void configure() {
                map().getName().setFirstname(source.getFirstName());
                map().getName().setSurname(source.getLastName());
            }
        });
        mapperFromEntity = new ModelMapper();
        mapperFromEntity.addMappings(new PropertyMap<Person, PersonDTO>() {
            @Override
            protected void configure() {
                map().setFirstName(source.getName().getFirstname());
                map().setLastName(source.getName().getSurname());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.