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

com.arextest.schedule.model.converter.ReplayPlanItemConverterImpl Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
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;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-08-22T12:50:10+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 11.0.24 (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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy