package com.ankaibei.workFlow.common.online.model;

import com.ankaibei.workFlow.common.online.model.OnlineDatasource.OnlineDatasourceModelMapper;
import com.ankaibei.workFlow.common.online.vo.OnlineDatasourceVo;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2023-05-08T14:15:47+0800",
    comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_144 (Oracle Corporation)"
)
public class OnlineDatasource$OnlineDatasourceModelMapperImpl implements OnlineDatasourceModelMapper {

    @Override
    public List<OnlineDatasourceVo> fromModelList(List<OnlineDatasource> arg0) {
        if ( arg0 == null ) {
            return null;
        }

        List<OnlineDatasourceVo> list = new ArrayList<OnlineDatasourceVo>( arg0.size() );
        for ( OnlineDatasource onlineDatasource : arg0 ) {
            list.add( fromModel( onlineDatasource ) );
        }

        return list;
    }

    @Override
    public List<OnlineDatasource> toModelList(List<OnlineDatasourceVo> arg0) {
        if ( arg0 == null ) {
            return null;
        }

        List<OnlineDatasource> list = new ArrayList<OnlineDatasource>( arg0.size() );
        for ( OnlineDatasourceVo onlineDatasourceVo : arg0 ) {
            list.add( toModel( onlineDatasourceVo ) );
        }

        return list;
    }

    @Override
    public OnlineDatasource toModel(OnlineDatasourceVo onlineDatasourceVo) {
        if ( onlineDatasourceVo == null ) {
            return null;
        }

        OnlineDatasource onlineDatasource = new OnlineDatasource();

        onlineDatasource.setDatasourceId( onlineDatasourceVo.getDatasourceId() );
        onlineDatasource.setDatasourceName( onlineDatasourceVo.getDatasourceName() );
        onlineDatasource.setVariableName( onlineDatasourceVo.getVariableName() );
        onlineDatasource.setDblinkId( onlineDatasourceVo.getDblinkId() );
        onlineDatasource.setMasterTableId( onlineDatasourceVo.getMasterTableId() );
        onlineDatasource.setUpdateTime( onlineDatasourceVo.getUpdateTime() );
        onlineDatasource.setCreateTime( onlineDatasourceVo.getCreateTime() );
        onlineDatasource.setMasterTableIdDictMap( mapToMap( onlineDatasourceVo.getMasterTableIdDictMap() ) );

        onlineDatasource.setOnlinePageDatasource( mapToBean(onlineDatasourceVo.getOnlinePageDatasource(), com.ankaibei.workFlow.common.online.model.OnlinePageDatasource.class) );
        onlineDatasource.setOnlineFormDatasource( mapToBean(onlineDatasourceVo.getOnlineFormDatasource(), com.ankaibei.workFlow.common.online.model.OnlineFormDatasource.class) );

        return onlineDatasource;
    }

    @Override
    public OnlineDatasourceVo fromModel(OnlineDatasource onlineDatasource) {
        if ( onlineDatasource == null ) {
            return null;
        }

        OnlineDatasourceVo onlineDatasourceVo = new OnlineDatasourceVo();

        onlineDatasourceVo.setDatasourceId( onlineDatasource.getDatasourceId() );
        onlineDatasourceVo.setDatasourceName( onlineDatasource.getDatasourceName() );
        onlineDatasourceVo.setVariableName( onlineDatasource.getVariableName() );
        onlineDatasourceVo.setDblinkId( onlineDatasource.getDblinkId() );
        onlineDatasourceVo.setMasterTableId( onlineDatasource.getMasterTableId() );
        onlineDatasourceVo.setUpdateTime( onlineDatasource.getUpdateTime() );
        onlineDatasourceVo.setCreateTime( onlineDatasource.getCreateTime() );
        onlineDatasourceVo.setMasterTableIdDictMap( mapToMap( onlineDatasource.getMasterTableIdDictMap() ) );

        onlineDatasourceVo.setOnlinePageDatasource( beanToMap(onlineDatasource.getOnlinePageDatasource(), false) );
        onlineDatasourceVo.setOnlineFormDatasource( beanToMap(onlineDatasource.getOnlineFormDatasource(), false) );

        return onlineDatasourceVo;
    }
}
