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

com.arextest.web.model.mapper.PlanItemMapperImpl Maven / Gradle / Ivy

package com.arextest.web.model.mapper;

import com.arextest.web.model.contract.contracts.ReportInitialRequestType;
import com.arextest.web.model.contract.contracts.replay.UpdateReportInfoRequestType;
import com.arextest.web.model.dao.mongodb.ReportPlanItemStatisticCollection;
import com.arextest.web.model.dto.PlanItemDto;
import java.util.LinkedHashMap;
import java.util.Map;

/*
@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-12-23T06:09:22+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 21.0.5 (Eclipse Adoptium)"
)
*/
public class PlanItemMapperImpl implements PlanItemMapper {

    @Override
    public ReportPlanItemStatisticCollection daoFromDto(PlanItemDto dto) {
        if ( dto == null ) {
            return null;
        }

        ReportPlanItemStatisticCollection reportPlanItemStatisticCollection = new ReportPlanItemStatisticCollection();

        reportPlanItemStatisticCollection.setPlanItemId( dto.getPlanItemId() );
        reportPlanItemStatisticCollection.setPlanId( dto.getPlanId() );
        reportPlanItemStatisticCollection.setOperationId( dto.getOperationId() );
        reportPlanItemStatisticCollection.setOperationName( dto.getOperationName() );
        reportPlanItemStatisticCollection.setServiceName( dto.getServiceName() );
        reportPlanItemStatisticCollection.setStatus( dto.getStatus() );
        reportPlanItemStatisticCollection.setErrorMessage( dto.getErrorMessage() );
        reportPlanItemStatisticCollection.setReplayStartTime( dto.getReplayStartTime() );
        reportPlanItemStatisticCollection.setReplayEndTime( dto.getReplayEndTime() );
        reportPlanItemStatisticCollection.setTotalCaseCount( dto.getTotalCaseCount() );
        Map map = dto.getCases();
        if ( map != null ) {
            reportPlanItemStatisticCollection.setCases( new LinkedHashMap( map ) );
        }
        Map map1 = dto.getFailCases();
        if ( map1 != null ) {
            reportPlanItemStatisticCollection.setFailCases( new LinkedHashMap( map1 ) );
        }
        Map map2 = dto.getErrorCases();
        if ( map2 != null ) {
            reportPlanItemStatisticCollection.setErrorCases( new LinkedHashMap( map2 ) );
        }

        return reportPlanItemStatisticCollection;
    }

    @Override
    public PlanItemDto dtoFromDao(ReportPlanItemStatisticCollection dao) {
        if ( dao == null ) {
            return null;
        }

        PlanItemDto planItemDto = new PlanItemDto();

        planItemDto.setPlanItemId( dao.getPlanItemId() );
        planItemDto.setPlanId( dao.getPlanId() );
        planItemDto.setOperationId( dao.getOperationId() );
        planItemDto.setOperationName( dao.getOperationName() );
        planItemDto.setServiceName( dao.getServiceName() );
        planItemDto.setStatus( dao.getStatus() );
        planItemDto.setErrorMessage( dao.getErrorMessage() );
        planItemDto.setReplayStartTime( dao.getReplayStartTime() );
        planItemDto.setReplayEndTime( dao.getReplayEndTime() );
        planItemDto.setTotalCaseCount( dao.getTotalCaseCount() );
        Map map = dao.getCases();
        if ( map != null ) {
            planItemDto.setCases( new LinkedHashMap( map ) );
        }
        Map map1 = dao.getFailCases();
        if ( map1 != null ) {
            planItemDto.setFailCases( new LinkedHashMap( map1 ) );
        }
        Map map2 = dao.getErrorCases();
        if ( map2 != null ) {
            planItemDto.setErrorCases( new LinkedHashMap( map2 ) );
        }

        return planItemDto;
    }

    @Override
    public PlanItemDto dtoFromContract(ReportInitialRequestType.ReportItem contract) {
        if ( contract == null ) {
            return null;
        }

        PlanItemDto planItemDto = new PlanItemDto();

        planItemDto.setPlanItemId( contract.getPlanItemId() );
        planItemDto.setOperationId( contract.getOperationId() );
        planItemDto.setOperationName( contract.getOperationName() );
        planItemDto.setServiceName( contract.getServiceName() );
        planItemDto.setTotalCaseCount( contract.getTotalCaseCount() );

        planItemDto.setStatus( 1 );

        return planItemDto;
    }

    @Override
    public PlanItemDto dtoFromContract(UpdateReportInfoRequestType.UpdateReportItem contract) {
        if ( contract == null ) {
            return null;
        }

        PlanItemDto planItemDto = new PlanItemDto();

        planItemDto.setPlanItemId( contract.getPlanItemId() );
        planItemDto.setTotalCaseCount( contract.getTotalCaseCount() );

        return planItemDto;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy