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

import com.ankaibei.workFlow.common.online.model.OnlineForm.OnlineFormModelMapper;
import com.ankaibei.workFlow.common.online.vo.OnlineFormVo;
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 OnlineForm$OnlineFormModelMapperImpl implements OnlineFormModelMapper {

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

        List<OnlineFormVo> list = new ArrayList<OnlineFormVo>( arg0.size() );
        for ( OnlineForm onlineForm : arg0 ) {
            list.add( fromModel( onlineForm ) );
        }

        return list;
    }

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

        List<OnlineForm> list = new ArrayList<OnlineForm>( arg0.size() );
        for ( OnlineFormVo onlineFormVo : arg0 ) {
            list.add( toModel( onlineFormVo ) );
        }

        return list;
    }

    @Override
    public OnlineForm toModel(OnlineFormVo onlineFormVo) {
        if ( onlineFormVo == null ) {
            return null;
        }

        OnlineForm onlineForm = new OnlineForm();

        onlineForm.setFormId( onlineFormVo.getFormId() );
        onlineForm.setPageId( onlineFormVo.getPageId() );
        onlineForm.setFormCode( onlineFormVo.getFormCode() );
        onlineForm.setFormName( onlineFormVo.getFormName() );
        onlineForm.setFormKind( onlineFormVo.getFormKind() );
        onlineForm.setFormType( onlineFormVo.getFormType() );
        onlineForm.setMasterTableId( onlineFormVo.getMasterTableId() );
        onlineForm.setWidgetJson( onlineFormVo.getWidgetJson() );
        onlineForm.setParamsJson( onlineFormVo.getParamsJson() );
        onlineForm.setUpdateTime( onlineFormVo.getUpdateTime() );
        onlineForm.setCreateTime( onlineFormVo.getCreateTime() );
        onlineForm.setMasterTableIdDictMap( mapToMap( onlineFormVo.getMasterTableIdDictMap() ) );
        onlineForm.setFormTypeDictMap( mapToMap( onlineFormVo.getFormTypeDictMap() ) );

        onlineForm.setOnlineTable( mapToBean(onlineFormVo.getOnlineTable(), com.ankaibei.workFlow.common.online.model.OnlineTable.class) );

        return onlineForm;
    }

    @Override
    public OnlineFormVo fromModel(OnlineForm onlineForm) {
        if ( onlineForm == null ) {
            return null;
        }

        OnlineFormVo onlineFormVo = new OnlineFormVo();

        onlineFormVo.setFormId( onlineForm.getFormId() );
        onlineFormVo.setPageId( onlineForm.getPageId() );
        onlineFormVo.setFormCode( onlineForm.getFormCode() );
        onlineFormVo.setFormName( onlineForm.getFormName() );
        onlineFormVo.setFormType( onlineForm.getFormType() );
        onlineFormVo.setFormKind( onlineForm.getFormKind() );
        onlineFormVo.setMasterTableId( onlineForm.getMasterTableId() );
        onlineFormVo.setWidgetJson( onlineForm.getWidgetJson() );
        onlineFormVo.setParamsJson( onlineForm.getParamsJson() );
        onlineFormVo.setUpdateTime( onlineForm.getUpdateTime() );
        onlineFormVo.setCreateTime( onlineForm.getCreateTime() );
        onlineFormVo.setMasterTableIdDictMap( mapToMap( onlineForm.getMasterTableIdDictMap() ) );
        onlineFormVo.setFormTypeDictMap( mapToMap( onlineForm.getFormTypeDictMap() ) );

        onlineFormVo.setOnlineTable( beanToMap(onlineForm.getOnlineTable(), false) );

        return onlineFormVo;
    }
}
