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

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

The newest version!
package com.arextest.web.model.mapper;

import com.arextest.web.model.contract.contracts.config.replay.ComparisonScriptConfiguration;
import com.arextest.web.model.dao.mongodb.ConfigComparisonScriptCollection;
import java.util.ArrayList;
import java.util.List;

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

    @Override
    public ComparisonScriptConfiguration dtoFromDao(ConfigComparisonScriptCollection dao) {
        if ( dao == null ) {
            return null;
        }

        ComparisonScriptConfiguration comparisonScriptConfiguration = new ComparisonScriptConfiguration();

        comparisonScriptConfiguration.setId( dao.getId() );
        comparisonScriptConfiguration.setAppId( dao.getAppId() );
        comparisonScriptConfiguration.setOperationId( dao.getOperationId() );
        comparisonScriptConfiguration.setExpirationType( dao.getExpirationType() );
        comparisonScriptConfiguration.setExpirationDate( dao.getExpirationDate() );
        comparisonScriptConfiguration.setCompareConfigType( dao.getCompareConfigType() );
        comparisonScriptConfiguration.setFsInterfaceId( dao.getFsInterfaceId() );
        comparisonScriptConfiguration.setDependencyId( dao.getDependencyId() );
        List list = dao.getNodePath();
        if ( list != null ) {
            comparisonScriptConfiguration.setNodePath( new ArrayList( list ) );
        }
        comparisonScriptConfiguration.setScriptMethod( scriptMethodDaoToScriptMethod( dao.getScriptMethod() ) );

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

        return comparisonScriptConfiguration;
    }

    @Override
    public ConfigComparisonScriptCollection daoFromDto(ComparisonScriptConfiguration dto) {
        if ( dto == null ) {
            return null;
        }

        ConfigComparisonScriptCollection configComparisonScriptCollection = new ConfigComparisonScriptCollection();

        configComparisonScriptCollection.setAppId( dto.getAppId() );
        configComparisonScriptCollection.setOperationId( dto.getOperationId() );
        configComparisonScriptCollection.setExpirationType( dto.getExpirationType() );
        configComparisonScriptCollection.setExpirationDate( dto.getExpirationDate() );
        configComparisonScriptCollection.setCompareConfigType( dto.getCompareConfigType() );
        configComparisonScriptCollection.setFsInterfaceId( dto.getFsInterfaceId() );
        configComparisonScriptCollection.setDependencyId( dto.getDependencyId() );
        List list = dto.getNodePath();
        if ( list != null ) {
            configComparisonScriptCollection.setNodePath( new ArrayList( list ) );
        }
        configComparisonScriptCollection.setScriptMethod( scriptMethodToScriptMethodDao( dto.getScriptMethod() ) );

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

        return configComparisonScriptCollection;
    }

    protected ComparisonScriptConfiguration.ScriptMethod scriptMethodDaoToScriptMethod(ConfigComparisonScriptCollection.ScriptMethodDao scriptMethodDao) {
        if ( scriptMethodDao == null ) {
            return null;
        }

        ComparisonScriptConfiguration.ScriptMethod scriptMethod = new ComparisonScriptConfiguration.ScriptMethod();

        scriptMethod.setFunctionId( scriptMethodDao.getFunctionId() );
        scriptMethod.setAliasName( scriptMethodDao.getAliasName() );
        scriptMethod.setFunctionArgs( scriptMethodDao.getFunctionArgs() );

        return scriptMethod;
    }

    protected ConfigComparisonScriptCollection.ScriptMethodDao scriptMethodToScriptMethodDao(ComparisonScriptConfiguration.ScriptMethod scriptMethod) {
        if ( scriptMethod == null ) {
            return null;
        }

        ConfigComparisonScriptCollection.ScriptMethodDao scriptMethodDao = new ConfigComparisonScriptCollection.ScriptMethodDao();

        scriptMethodDao.setFunctionId( scriptMethod.getFunctionId() );
        scriptMethodDao.setAliasName( scriptMethod.getAliasName() );
        scriptMethodDao.setFunctionArgs( scriptMethod.getFunctionArgs() );

        return scriptMethodDao;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy