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

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

There is a newer version: 0.6.5.5
Show newest version
package com.arextest.web.model.mapper;

import com.arextest.web.model.contract.contracts.common.KeyValuePairType;
import com.arextest.web.model.contract.contracts.environment.EnvironmentType;
import com.arextest.web.model.dao.mongodb.EnvironmentCollection;
import com.arextest.web.model.dao.mongodb.entity.KeyValuePairDao;
import com.arextest.web.model.dto.EnvironmentDto;
import com.arextest.web.model.dto.KeyValuePairDto;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-09-25T05:48:00+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 11.0.24 (Eclipse Adoptium)"
)
public class EnvironmentMapperImpl implements EnvironmentMapper {

    @Override
    public EnvironmentCollection daoFromDto(EnvironmentDto dto) {
        if ( dto == null ) {
            return null;
        }

        EnvironmentCollection environmentCollection = new EnvironmentCollection();

        environmentCollection.setId( dto.getId() );
        environmentCollection.setWorkspaceId( dto.getWorkspaceId() );
        environmentCollection.setEnvName( dto.getEnvName() );
        environmentCollection.setKeyValues( keyValuePairDtoListToKeyValuePairDaoList( dto.getKeyValues() ) );

        return environmentCollection;
    }

    @Override
    public EnvironmentDto dtoFromDao(EnvironmentCollection dao) {
        if ( dao == null ) {
            return null;
        }

        EnvironmentDto environmentDto = new EnvironmentDto();

        environmentDto.setId( dao.getId() );
        environmentDto.setWorkspaceId( dao.getWorkspaceId() );
        environmentDto.setEnvName( dao.getEnvName() );
        environmentDto.setKeyValues( keyValuePairDaoListToKeyValuePairDtoList( dao.getKeyValues() ) );

        return environmentDto;
    }

    @Override
    public List dtoFromDaoList(List dao) {
        if ( dao == null ) {
            return null;
        }

        List list = new ArrayList( dao.size() );
        for ( EnvironmentCollection environmentCollection : dao ) {
            list.add( dtoFromDao( environmentCollection ) );
        }

        return list;
    }

    @Override
    public EnvironmentDto dtoFromContract(EnvironmentType contract) {
        if ( contract == null ) {
            return null;
        }

        EnvironmentDto environmentDto = new EnvironmentDto();

        environmentDto.setId( contract.getId() );
        environmentDto.setWorkspaceId( contract.getWorkspaceId() );
        environmentDto.setEnvName( contract.getEnvName() );
        environmentDto.setKeyValues( keyValuePairTypeListToKeyValuePairDtoList( contract.getKeyValues() ) );

        return environmentDto;
    }

    @Override
    public List contractFromDtoList(List dto) {
        if ( dto == null ) {
            return null;
        }

        List list = new ArrayList( dto.size() );
        for ( EnvironmentDto environmentDto : dto ) {
            list.add( environmentDtoToEnvironmentType( environmentDto ) );
        }

        return list;
    }

    protected KeyValuePairDao keyValuePairDtoToKeyValuePairDao(KeyValuePairDto keyValuePairDto) {
        if ( keyValuePairDto == null ) {
            return null;
        }

        KeyValuePairDao keyValuePairDao = new KeyValuePairDao();

        keyValuePairDao.setKey( keyValuePairDto.getKey() );
        keyValuePairDao.setValue( keyValuePairDto.getValue() );
        keyValuePairDao.setActive( keyValuePairDto.getActive() );

        return keyValuePairDao;
    }

    protected List keyValuePairDtoListToKeyValuePairDaoList(List list) {
        if ( list == null ) {
            return null;
        }

        List list1 = new ArrayList( list.size() );
        for ( KeyValuePairDto keyValuePairDto : list ) {
            list1.add( keyValuePairDtoToKeyValuePairDao( keyValuePairDto ) );
        }

        return list1;
    }

    protected KeyValuePairDto keyValuePairDaoToKeyValuePairDto(KeyValuePairDao keyValuePairDao) {
        if ( keyValuePairDao == null ) {
            return null;
        }

        KeyValuePairDto keyValuePairDto = new KeyValuePairDto();

        keyValuePairDto.setKey( keyValuePairDao.getKey() );
        keyValuePairDto.setValue( keyValuePairDao.getValue() );
        keyValuePairDto.setActive( keyValuePairDao.getActive() );

        return keyValuePairDto;
    }

    protected List keyValuePairDaoListToKeyValuePairDtoList(List list) {
        if ( list == null ) {
            return null;
        }

        List list1 = new ArrayList( list.size() );
        for ( KeyValuePairDao keyValuePairDao : list ) {
            list1.add( keyValuePairDaoToKeyValuePairDto( keyValuePairDao ) );
        }

        return list1;
    }

    protected KeyValuePairDto keyValuePairTypeToKeyValuePairDto(KeyValuePairType keyValuePairType) {
        if ( keyValuePairType == null ) {
            return null;
        }

        KeyValuePairDto keyValuePairDto = new KeyValuePairDto();

        keyValuePairDto.setKey( keyValuePairType.getKey() );
        keyValuePairDto.setValue( keyValuePairType.getValue() );
        keyValuePairDto.setActive( keyValuePairType.getActive() );

        return keyValuePairDto;
    }

    protected List keyValuePairTypeListToKeyValuePairDtoList(List list) {
        if ( list == null ) {
            return null;
        }

        List list1 = new ArrayList( list.size() );
        for ( KeyValuePairType keyValuePairType : list ) {
            list1.add( keyValuePairTypeToKeyValuePairDto( keyValuePairType ) );
        }

        return list1;
    }

    protected KeyValuePairType keyValuePairDtoToKeyValuePairType(KeyValuePairDto keyValuePairDto) {
        if ( keyValuePairDto == null ) {
            return null;
        }

        KeyValuePairType keyValuePairType = new KeyValuePairType();

        keyValuePairType.setKey( keyValuePairDto.getKey() );
        keyValuePairType.setValue( keyValuePairDto.getValue() );
        keyValuePairType.setActive( keyValuePairDto.getActive() );

        return keyValuePairType;
    }

    protected List keyValuePairDtoListToKeyValuePairTypeList(List list) {
        if ( list == null ) {
            return null;
        }

        List list1 = new ArrayList( list.size() );
        for ( KeyValuePairDto keyValuePairDto : list ) {
            list1.add( keyValuePairDtoToKeyValuePairType( keyValuePairDto ) );
        }

        return list1;
    }

    protected EnvironmentType environmentDtoToEnvironmentType(EnvironmentDto environmentDto) {
        if ( environmentDto == null ) {
            return null;
        }

        EnvironmentType environmentType = new EnvironmentType();

        environmentType.setId( environmentDto.getId() );
        environmentType.setWorkspaceId( environmentDto.getWorkspaceId() );
        environmentType.setEnvName( environmentDto.getEnvName() );
        environmentType.setKeyValues( keyValuePairDtoListToKeyValuePairTypeList( environmentDto.getKeyValues() ) );

        return environmentType;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy