com.arextest.web.model.mapper.CaseSummaryMapperImpl Maven / Gradle / Ivy
The newest version!
package com.arextest.web.model.mapper;
import com.arextest.web.model.dao.mongodb.iosummary.CaseSummaryCollection;
import com.arextest.web.model.dao.mongodb.iosummary.DiffDetailDao;
import com.arextest.web.model.dto.iosummary.CaseSummary;
import com.arextest.web.model.dto.iosummary.DiffDetail;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-09-26T09:42:06+0000",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 11.0.24 (Eclipse Adoptium)"
)
public class CaseSummaryMapperImpl implements CaseSummaryMapper {
@Override
public CaseSummary dtoFromDao(CaseSummaryCollection dao) {
if ( dao == null ) {
return null;
}
CaseSummary caseSummary = new CaseSummary();
caseSummary.setCode( dao.getCode() );
caseSummary.setRecordId( dao.getRecordId() );
caseSummary.setReplayId( dao.getReplayId() );
caseSummary.setPlanId( dao.getPlanId() );
caseSummary.setPlanItemId( dao.getPlanItemId() );
caseSummary.setDiffs( diffDetailDaoListToDiffDetailList( dao.getDiffs() ) );
return caseSummary;
}
@Override
public CaseSummaryCollection daoFromDto(CaseSummary dto) {
if ( dto == null ) {
return null;
}
CaseSummaryCollection caseSummaryCollection = new CaseSummaryCollection();
caseSummaryCollection.setCode( dto.getCode() );
caseSummaryCollection.setRecordId( dto.getRecordId() );
caseSummaryCollection.setReplayId( dto.getReplayId() );
caseSummaryCollection.setPlanId( dto.getPlanId() );
caseSummaryCollection.setPlanItemId( dto.getPlanItemId() );
caseSummaryCollection.setDiffs( diffDetailListToDiffDetailDaoList( dto.getDiffs() ) );
caseSummaryCollection.setDataCreateTime( new java.util.Date() );
return caseSummaryCollection;
}
protected DiffDetail diffDetailDaoToDiffDetail(DiffDetailDao diffDetailDao) {
if ( diffDetailDao == null ) {
return null;
}
DiffDetail diffDetail = new DiffDetail();
diffDetail.setCode( diffDetailDao.getCode() );
diffDetail.setCategoryName( diffDetailDao.getCategoryName() );
diffDetail.setOperationName( diffDetailDao.getOperationName() );
return diffDetail;
}
protected List diffDetailDaoListToDiffDetailList(List list) {
if ( list == null ) {
return null;
}
List list1 = new ArrayList( list.size() );
for ( DiffDetailDao diffDetailDao : list ) {
list1.add( diffDetailDaoToDiffDetail( diffDetailDao ) );
}
return list1;
}
protected DiffDetailDao diffDetailToDiffDetailDao(DiffDetail diffDetail) {
if ( diffDetail == null ) {
return null;
}
DiffDetailDao diffDetailDao = new DiffDetailDao();
diffDetailDao.setCode( diffDetail.getCode() );
diffDetailDao.setCategoryName( diffDetail.getCategoryName() );
diffDetailDao.setOperationName( diffDetail.getOperationName() );
return diffDetailDao;
}
protected List diffDetailListToDiffDetailDaoList(List list) {
if ( list == null ) {
return null;
}
List list1 = new ArrayList( list.size() );
for ( DiffDetail diffDetail : list ) {
list1.add( diffDetailToDiffDetailDao( diffDetail ) );
}
return list1;
}
}