EntityWithServiceImplAndDTOMapperImpl.java

package io.github.jhipster.sample.service.mapper;

import io.github.jhipster.sample.domain.EntityWithServiceImplAndDTO;
import io.github.jhipster.sample.service.dto.EntityWithServiceImplAndDTODTO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
import org.springframework.stereotype.Component;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2017-12-14T19:40:11+0000",
    comments = "version: 1.2.0.Final, compiler: javac, environment: Java 1.8.0_151 (Oracle Corporation)"
)
@Component
public class EntityWithServiceImplAndDTOMapperImpl implements EntityWithServiceImplAndDTOMapper {

    @Override
    public EntityWithServiceImplAndDTO toEntity(EntityWithServiceImplAndDTODTO dto) {
        if ( dto == null ) {
            return null;
        }

        EntityWithServiceImplAndDTO entityWithServiceImplAndDTO = new EntityWithServiceImplAndDTO();

        entityWithServiceImplAndDTO.setId( dto.getId() );
        entityWithServiceImplAndDTO.setLouis( dto.getLouis() );

        return entityWithServiceImplAndDTO;
    }

    @Override
    public EntityWithServiceImplAndDTODTO toDto(EntityWithServiceImplAndDTO entity) {
        if ( entity == null ) {
            return null;
        }

        EntityWithServiceImplAndDTODTO entityWithServiceImplAndDTODTO = new EntityWithServiceImplAndDTODTO();

        entityWithServiceImplAndDTODTO.setId( entity.getId() );
        entityWithServiceImplAndDTODTO.setLouis( entity.getLouis() );

        return entityWithServiceImplAndDTODTO;
    }

    @Override
    public List<EntityWithServiceImplAndDTO> toEntity(List<EntityWithServiceImplAndDTODTO> dtoList) {
        if ( dtoList == null ) {
            return null;
        }

        List<EntityWithServiceImplAndDTO> list = new ArrayList<EntityWithServiceImplAndDTO>( dtoList.size() );
        for ( EntityWithServiceImplAndDTODTO entityWithServiceImplAndDTODTO : dtoList ) {
            list.add( toEntity( entityWithServiceImplAndDTODTO ) );
        }

        return list;
    }

    @Override
    public List<EntityWithServiceImplAndDTODTO> toDto(List<EntityWithServiceImplAndDTO> entityList) {
        if ( entityList == null ) {
            return null;
        }

        List<EntityWithServiceImplAndDTODTO> list = new ArrayList<EntityWithServiceImplAndDTODTO>( entityList.size() );
        for ( EntityWithServiceImplAndDTO entityWithServiceImplAndDTO : entityList ) {
            list.add( toDto( entityWithServiceImplAndDTO ) );
        }

        return list;
    }
}