EntityWithServiceClassAndDTOMapperImpl.java

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

import io.github.jhipster.sample.domain.EntityWithServiceClassAndDTO;
import io.github.jhipster.sample.service.dto.EntityWithServiceClassAndDTODTO;
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 EntityWithServiceClassAndDTOMapperImpl implements EntityWithServiceClassAndDTOMapper {

    @Override
    public EntityWithServiceClassAndDTO toEntity(EntityWithServiceClassAndDTODTO dto) {
        if ( dto == null ) {
            return null;
        }

        EntityWithServiceClassAndDTO entityWithServiceClassAndDTO = new EntityWithServiceClassAndDTO();

        entityWithServiceClassAndDTO.setId( dto.getId() );
        entityWithServiceClassAndDTO.setLucas( dto.getLucas() );

        return entityWithServiceClassAndDTO;
    }

    @Override
    public EntityWithServiceClassAndDTODTO toDto(EntityWithServiceClassAndDTO entity) {
        if ( entity == null ) {
            return null;
        }

        EntityWithServiceClassAndDTODTO entityWithServiceClassAndDTODTO = new EntityWithServiceClassAndDTODTO();

        entityWithServiceClassAndDTODTO.setId( entity.getId() );
        entityWithServiceClassAndDTODTO.setLucas( entity.getLucas() );

        return entityWithServiceClassAndDTODTO;
    }

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

        List<EntityWithServiceClassAndDTO> list = new ArrayList<EntityWithServiceClassAndDTO>( dtoList.size() );
        for ( EntityWithServiceClassAndDTODTO entityWithServiceClassAndDTODTO : dtoList ) {
            list.add( toEntity( entityWithServiceClassAndDTODTO ) );
        }

        return list;
    }

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

        List<EntityWithServiceClassAndDTODTO> list = new ArrayList<EntityWithServiceClassAndDTODTO>( entityList.size() );
        for ( EntityWithServiceClassAndDTO entityWithServiceClassAndDTO : entityList ) {
            list.add( toDto( entityWithServiceClassAndDTO ) );
        }

        return list;
    }
}