com.aizuda.snailjob.server.web.service.convert.JobBatchResponseVOConverterImpl Maven / Gradle / Ivy
package com.aizuda.snailjob.server.web.service.convert;
import com.aizuda.snailjob.server.web.model.response.JobBatchResponseVO;
import com.aizuda.snailjob.template.datasource.persistence.dataobject.JobBatchResponseDO;
import com.aizuda.snailjob.template.datasource.persistence.po.Job;
import com.aizuda.snailjob.template.datasource.persistence.po.JobTaskBatch;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.processing.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-05-29T12:27:56+0800",
comments = "version: 1.5.3.Final, compiler: javac, environment: Java 17.0.10 (Amazon.com Inc.)"
)
public class JobBatchResponseVOConverterImpl implements JobBatchResponseVOConverter {
@Override
public List convertList(List jobBatches) {
if ( jobBatches == null ) {
return null;
}
List list = new ArrayList( jobBatches.size() );
for ( JobBatchResponseDO jobBatchResponseDO : jobBatches ) {
list.add( convert( jobBatchResponseDO ) );
}
return list;
}
@Override
public JobBatchResponseVO convert(JobBatchResponseDO jobBatchResponseDO) {
if ( jobBatchResponseDO == null ) {
return null;
}
JobBatchResponseVO jobBatchResponseVO = new JobBatchResponseVO();
jobBatchResponseVO.setId( jobBatchResponseDO.getId() );
jobBatchResponseVO.setGroupName( jobBatchResponseDO.getGroupName() );
jobBatchResponseVO.setJobName( jobBatchResponseDO.getJobName() );
jobBatchResponseVO.setJobId( jobBatchResponseDO.getJobId() );
jobBatchResponseVO.setTaskBatchStatus( jobBatchResponseDO.getTaskBatchStatus() );
jobBatchResponseVO.setCreateDt( jobBatchResponseDO.getCreateDt() );
jobBatchResponseVO.setOperationReason( jobBatchResponseDO.getOperationReason() );
jobBatchResponseVO.setExecutorType( jobBatchResponseDO.getExecutorType() );
jobBatchResponseVO.setExecutorInfo( jobBatchResponseDO.getExecutorInfo() );
jobBatchResponseVO.setExecutionAt( JobBatchResponseVOConverter.toLocalDateTime(jobBatchResponseDO.getExecutionAt()) );
return jobBatchResponseVO;
}
@Override
public List convertListToJobBatchList(List jobTaskBatchList) {
if ( jobTaskBatchList == null ) {
return null;
}
List list = new ArrayList( jobTaskBatchList.size() );
for ( JobTaskBatch jobTaskBatch : jobTaskBatchList ) {
list.add( convert( jobTaskBatch ) );
}
return list;
}
@Override
public JobBatchResponseVO convert(JobTaskBatch jobTaskBatch) {
if ( jobTaskBatch == null ) {
return null;
}
JobBatchResponseVO jobBatchResponseVO = new JobBatchResponseVO();
jobBatchResponseVO.setId( jobTaskBatch.getId() );
jobBatchResponseVO.setGroupName( jobTaskBatch.getGroupName() );
jobBatchResponseVO.setJobId( jobTaskBatch.getJobId() );
jobBatchResponseVO.setTaskBatchStatus( jobTaskBatch.getTaskBatchStatus() );
jobBatchResponseVO.setCreateDt( jobTaskBatch.getCreateDt() );
jobBatchResponseVO.setOperationReason( jobTaskBatch.getOperationReason() );
jobBatchResponseVO.setWorkflowTaskBatchId( jobTaskBatch.getWorkflowTaskBatchId() );
jobBatchResponseVO.setWorkflowNodeId( jobTaskBatch.getWorkflowNodeId() );
jobBatchResponseVO.setExecutionAt( JobBatchResponseVOConverter.toLocalDateTime(jobTaskBatch.getExecutionAt()) );
return jobBatchResponseVO;
}
@Override
public JobBatchResponseVO convert(JobTaskBatch jobBatch, Job job) {
if ( jobBatch == null && job == null ) {
return null;
}
JobBatchResponseVO jobBatchResponseVO = new JobBatchResponseVO();
if ( jobBatch != null ) {
jobBatchResponseVO.setGroupName( jobBatch.getGroupName() );
jobBatchResponseVO.setId( jobBatch.getId() );
jobBatchResponseVO.setCreateDt( jobBatch.getCreateDt() );
jobBatchResponseVO.setJobId( jobBatch.getJobId() );
jobBatchResponseVO.setTaskBatchStatus( jobBatch.getTaskBatchStatus() );
jobBatchResponseVO.setOperationReason( jobBatch.getOperationReason() );
jobBatchResponseVO.setWorkflowTaskBatchId( jobBatch.getWorkflowTaskBatchId() );
jobBatchResponseVO.setWorkflowNodeId( jobBatch.getWorkflowNodeId() );
}
if ( job != null ) {
jobBatchResponseVO.setJobName( job.getJobName() );
jobBatchResponseVO.setExecutorType( job.getExecutorType() );
jobBatchResponseVO.setExecutorInfo( job.getExecutorInfo() );
}
jobBatchResponseVO.setExecutionAt( JobBatchResponseVOConverter.toLocalDateTime(jobBatch.getExecutionAt()) );
return jobBatchResponseVO;
}
}