com.arextest.schedule.model.converter.ReplayPlanItemConverterImpl Maven / Gradle / Ivy
package com.arextest.schedule.model.converter;
import com.arextest.schedule.model.ReplayActionItem;
import com.arextest.schedule.model.dao.mongodb.ReplayPlanItemCollection;
import java.util.LinkedHashMap;
import java.util.Map;
/*
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-10-23T07:32:39+0000",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 21.0.4 (Eclipse Adoptium)"
)
*/
public class ReplayPlanItemConverterImpl implements ReplayPlanItemConverter {
@Override
public ReplayActionItem dtoFromDao(ReplayPlanItemCollection dao) {
if ( dao == null ) {
return null;
}
ReplayActionItem replayActionItem = new ReplayActionItem();
replayActionItem.setId( dao.getId() );
replayActionItem.setOperationId( dao.getOperationId() );
replayActionItem.setPlanId( dao.getPlanId() );
replayActionItem.setReplayStatus( dao.getReplayStatus() );
replayActionItem.setReplayBeginTime( dao.getReplayBeginTime() );
replayActionItem.setReplayFinishTime( dao.getReplayFinishTime() );
replayActionItem.setReplayCaseCount( dao.getReplayCaseCount() );
replayActionItem.setAppId( dao.getAppId() );
Map map = dao.getNoiseFinishedContexts();
if ( map != null ) {
replayActionItem.setNoiseFinishedContexts( new LinkedHashMap( map ) );
}
return replayActionItem;
}
@Override
public ReplayPlanItemCollection daoFromDto(ReplayActionItem dto) {
if ( dto == null ) {
return null;
}
ReplayPlanItemCollection replayPlanItemCollection = new ReplayPlanItemCollection();
replayPlanItemCollection.setAppId( dto.getAppId() );
replayPlanItemCollection.setOperationId( dto.getOperationId() );
replayPlanItemCollection.setPlanId( dto.getPlanId() );
replayPlanItemCollection.setReplayCaseCount( dto.getReplayCaseCount() );
Map map = dto.getNoiseFinishedContexts();
if ( map != null ) {
replayPlanItemCollection.setNoiseFinishedContexts( new LinkedHashMap( map ) );
}
replayPlanItemCollection.setReplayStatus( dto.getReplayStatus() );
replayPlanItemCollection.setReplayBeginTime( dto.getReplayBeginTime() );
replayPlanItemCollection.setReplayFinishTime( dto.getReplayFinishTime() );
replayPlanItemCollection.setId( null );
replayPlanItemCollection.setDataChangeCreateTime( System.currentTimeMillis() );
replayPlanItemCollection.setDataChangeUpdateTime( System.currentTimeMillis() );
replayPlanItemCollection.setDataChangeCreateDate( new java.util.Date() );
return replayPlanItemCollection;
}
}