All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.migoo.framework.infra.convert.developer.job.JobConvertImpl Maven / Gradle / Ivy

The newest version!
package xyz.migoo.framework.infra.convert.developer.job;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.processing.Generated;
import xyz.migoo.framework.common.pojo.PageResult;
import xyz.migoo.framework.infra.controller.developer.job.vo.JobCreateReqVO;
import xyz.migoo.framework.infra.controller.developer.job.vo.JobRespVO;
import xyz.migoo.framework.infra.controller.developer.job.vo.JobUpdateReqVO;
import xyz.migoo.framework.infra.dal.dataobject.developer.job.JobDO;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-11-29T19:15:12+0800",
    comments = "version: 1.6.0, compiler: javac, environment: Java 21.0.3 (Oracle Corporation)"
)
public class JobConvertImpl implements JobConvert {

    @Override
    public JobDO convert(JobCreateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        JobDO jobDO = new JobDO();

        jobDO.setName( bean.getName() );
        jobDO.setHandlerName( bean.getHandlerName() );
        jobDO.setHandlerParam( bean.getHandlerParam() );
        jobDO.setCronExpression( bean.getCronExpression() );
        jobDO.setRetryCount( bean.getRetryCount() );
        jobDO.setRetryInterval( bean.getRetryInterval() );
        jobDO.setMonitorTimeout( bean.getMonitorTimeout() );

        return jobDO;
    }

    @Override
    public JobDO convert(JobUpdateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        JobDO jobDO = new JobDO();

        jobDO.setId( bean.getId() );
        jobDO.setName( bean.getName() );
        jobDO.setHandlerParam( bean.getHandlerParam() );
        jobDO.setCronExpression( bean.getCronExpression() );
        jobDO.setRetryCount( bean.getRetryCount() );
        jobDO.setRetryInterval( bean.getRetryInterval() );
        jobDO.setMonitorTimeout( bean.getMonitorTimeout() );

        return jobDO;
    }

    @Override
    public JobRespVO convert(JobDO bean) {
        if ( bean == null ) {
            return null;
        }

        JobRespVO jobRespVO = new JobRespVO();

        jobRespVO.setName( bean.getName() );
        jobRespVO.setHandlerParam( bean.getHandlerParam() );
        jobRespVO.setCronExpression( bean.getCronExpression() );
        jobRespVO.setRetryCount( bean.getRetryCount() );
        jobRespVO.setRetryInterval( bean.getRetryInterval() );
        jobRespVO.setMonitorTimeout( bean.getMonitorTimeout() );
        jobRespVO.setId( bean.getId() );
        jobRespVO.setStatus( bean.getStatus() );
        jobRespVO.setHandlerName( bean.getHandlerName() );

        return jobRespVO;
    }

    @Override
    public List convertList(List list) {
        if ( list == null ) {
            return null;
        }

        List list1 = new ArrayList( list.size() );
        for ( JobDO jobDO : list ) {
            list1.add( convert( jobDO ) );
        }

        return list1;
    }

    @Override
    public PageResult convertPage(PageResult page) {
        if ( page == null ) {
            return null;
        }

        PageResult pageResult = new PageResult();

        pageResult.setList( convertList( page.getList() ) );
        pageResult.setTotal( page.getTotal() );

        return pageResult;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy