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

com.arextest.config.mapper.ServiceOperationMapperImpl Maven / Gradle / Ivy

package com.arextest.config.mapper;

import com.arextest.config.model.dao.config.ServiceOperationCollection;
import com.arextest.config.model.dto.application.ApplicationOperationConfiguration;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-09-19T06:47:37+0000",
    comments = "version: 1.2.0.Final, compiler: javac, environment: Java 11.0.24 (Eclipse Adoptium)"
)
public class ServiceOperationMapperImpl implements ServiceOperationMapper {

    @Override
    public ApplicationOperationConfiguration dtoFromDao(ServiceOperationCollection dao) {
        if ( dao == null ) {
            return null;
        }

        ApplicationOperationConfiguration applicationOperationConfiguration = new ApplicationOperationConfiguration();

        applicationOperationConfiguration.setStatus( dao.getStatus() );
        applicationOperationConfiguration.setId( dao.getId() );
        applicationOperationConfiguration.setAppId( dao.getAppId() );
        applicationOperationConfiguration.setServiceId( dao.getServiceId() );
        applicationOperationConfiguration.setOperationName( dao.getOperationName() );
        applicationOperationConfiguration.setOperationType( dao.getOperationType() );
        Set set = dao.getOperationTypes();
        if ( set != null ) {
            applicationOperationConfiguration.setOperationTypes( new HashSet( set ) );
        }
        else {
            applicationOperationConfiguration.setOperationTypes( null );
        }
        applicationOperationConfiguration.setOperationResponse( dao.getOperationResponse() );
        applicationOperationConfiguration.setRecordedCaseCount( dao.getRecordedCaseCount() );

        applicationOperationConfiguration.setModifiedTime( dao.getDataChangeUpdateTime() == null ? null : new java.sql.Timestamp(dao.getDataChangeUpdateTime()) );

        return applicationOperationConfiguration;
    }

    @Override
    public ApplicationOperationConfiguration baseInfoFromDao(ServiceOperationCollection dao) {
        if ( dao == null ) {
            return null;
        }

        ApplicationOperationConfiguration applicationOperationConfiguration = new ApplicationOperationConfiguration();

        applicationOperationConfiguration.setStatus( dao.getStatus() );
        applicationOperationConfiguration.setId( dao.getId() );
        applicationOperationConfiguration.setAppId( dao.getAppId() );
        applicationOperationConfiguration.setServiceId( dao.getServiceId() );
        applicationOperationConfiguration.setOperationName( dao.getOperationName() );
        applicationOperationConfiguration.setOperationType( dao.getOperationType() );
        Set set = dao.getOperationTypes();
        if ( set != null ) {
            applicationOperationConfiguration.setOperationTypes( new HashSet( set ) );
        }
        else {
            applicationOperationConfiguration.setOperationTypes( null );
        }
        applicationOperationConfiguration.setRecordedCaseCount( dao.getRecordedCaseCount() );

        applicationOperationConfiguration.setModifiedTime( dao.getDataChangeUpdateTime() == null ? null : new java.sql.Timestamp(dao.getDataChangeUpdateTime()) );
        applicationOperationConfiguration.setOperationResponse( null );

        return applicationOperationConfiguration;
    }

    @Override
    public ServiceOperationCollection daoFromDto(ApplicationOperationConfiguration dto) {
        if ( dto == null ) {
            return null;
        }

        ServiceOperationCollection serviceOperationCollection = new ServiceOperationCollection();

        serviceOperationCollection.setAppId( dto.getAppId() );
        serviceOperationCollection.setServiceId( dto.getServiceId() );
        serviceOperationCollection.setOperationName( dto.getOperationName() );
        serviceOperationCollection.setOperationResponse( dto.getOperationResponse() );
        serviceOperationCollection.setOperationType( dto.getOperationType() );
        Set set = dto.getOperationTypes();
        if ( set != null ) {
            serviceOperationCollection.setOperationTypes( new HashSet( set ) );
        }
        else {
            serviceOperationCollection.setOperationTypes( null );
        }
        serviceOperationCollection.setRecordedCaseCount( dto.getRecordedCaseCount() );
        serviceOperationCollection.setStatus( dto.getStatus() );

        serviceOperationCollection.setId( null );
        serviceOperationCollection.setDataChangeCreateTime( System.currentTimeMillis() );
        serviceOperationCollection.setDataChangeUpdateTime( System.currentTimeMillis() );

        return serviceOperationCollection;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy