package cn.datax.service.data.factory.mapstruct;

import cn.datax.service.data.factory.api.dto.DataSourceDto;
import cn.datax.service.data.factory.api.entity.DataSourceEntity;
import cn.datax.service.data.factory.api.vo.DataSourceVo;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
import org.springframework.stereotype.Component;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2020-04-06T12:17:20+0800",
    comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_231 (Oracle Corporation)"
)
@Component
public class DataSourceMapperImpl implements DataSourceMapper {

    @Override
    public DataSourceDto toDTO(DataSourceEntity arg0) {
        if ( arg0 == null ) {
            return null;
        }

        DataSourceDto dataSourceDto = new DataSourceDto();

        dataSourceDto.setId( arg0.getId() );
        dataSourceDto.setDbType( arg0.getDbType() );
        dataSourceDto.setSourceName( arg0.getSourceName() );
        dataSourceDto.setRemark( arg0.getRemark() );
        dataSourceDto.setDbSchema( arg0.getDbSchema() );

        return dataSourceDto;
    }

    @Override
    public List<DataSourceDto> toDTO(List<DataSourceEntity> arg0) {
        if ( arg0 == null ) {
            return null;
        }

        List<DataSourceDto> list = new ArrayList<DataSourceDto>( arg0.size() );
        for ( DataSourceEntity dataSourceEntity : arg0 ) {
            list.add( toDTO( dataSourceEntity ) );
        }

        return list;
    }

    @Override
    public DataSourceVo toVO(DataSourceEntity arg0) {
        if ( arg0 == null ) {
            return null;
        }

        DataSourceVo dataSourceVo = new DataSourceVo();

        dataSourceVo.setId( arg0.getId() );
        dataSourceVo.setStatus( arg0.getStatus() );
        dataSourceVo.setCreateTime( arg0.getCreateTime() );
        dataSourceVo.setDbType( arg0.getDbType() );
        dataSourceVo.setSourceName( arg0.getSourceName() );
        dataSourceVo.setRemark( arg0.getRemark() );
        dataSourceVo.setDbSchema( arg0.getDbSchema() );

        return dataSourceVo;
    }

    @Override
    public List<DataSourceVo> toVO(List<DataSourceEntity> arg0) {
        if ( arg0 == null ) {
            return null;
        }

        List<DataSourceVo> list = new ArrayList<DataSourceVo>( arg0.size() );
        for ( DataSourceEntity dataSourceEntity : arg0 ) {
            list.add( toVO( dataSourceEntity ) );
        }

        return list;
    }

    @Override
    public DataSourceEntity toEntity(DataSourceDto arg0) {
        if ( arg0 == null ) {
            return null;
        }

        DataSourceEntity dataSourceEntity = new DataSourceEntity();

        dataSourceEntity.setId( arg0.getId() );
        dataSourceEntity.setDbType( arg0.getDbType() );
        dataSourceEntity.setSourceName( arg0.getSourceName() );
        dataSourceEntity.setRemark( arg0.getRemark() );
        dataSourceEntity.setDbSchema( arg0.getDbSchema() );

        return dataSourceEntity;
    }

    @Override
    public List<DataSourceEntity> toEntity(List<DataSourceDto> arg0) {
        if ( arg0 == null ) {
            return null;
        }

        List<DataSourceEntity> list = new ArrayList<DataSourceEntity>( arg0.size() );
        for ( DataSourceDto dataSourceDto : arg0 ) {
            list.add( toEntity( dataSourceDto ) );
        }

        return list;
    }
}
