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

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

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

import com.arextest.web.model.contract.contracts.common.KeyValuePairType;
import com.arextest.web.model.contract.contracts.common.ScriptBlockType;
import com.arextest.web.model.contract.contracts.filesystem.AddressType;
import com.arextest.web.model.contract.contracts.filesystem.AuthType;
import com.arextest.web.model.contract.contracts.filesystem.BodyType;
import com.arextest.web.model.contract.contracts.filesystem.FSQueryInterfaceResponseType;
import com.arextest.web.model.contract.contracts.filesystem.FSSaveInterfaceRequestType;
import com.arextest.web.model.contract.contracts.filesystem.FormDataType;
import com.arextest.web.model.dao.mongodb.FSInterfaceCollection;
import com.arextest.web.model.dao.mongodb.entity.AddressDao;
import com.arextest.web.model.dao.mongodb.entity.AuthDao;
import com.arextest.web.model.dao.mongodb.entity.BodyDao;
import com.arextest.web.model.dao.mongodb.entity.FormDataDao;
import com.arextest.web.model.dao.mongodb.entity.KeyValuePairDao;
import com.arextest.web.model.dao.mongodb.entity.ScriptBlockDao;
import com.arextest.web.model.dto.KeyValuePairDto;
import com.arextest.web.model.dto.filesystem.AddressDto;
import com.arextest.web.model.dto.filesystem.AuthDto;
import com.arextest.web.model.dto.filesystem.BodyDto;
import com.arextest.web.model.dto.filesystem.FSInterfaceDto;
import com.arextest.web.model.dto.filesystem.FormDataDto;
import com.arextest.web.model.dto.filesystem.ScriptBlockDto;
import com.arextest.web.model.dto.filesystem.importexport.InterfaceItemDto;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/*
@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 FSInterfaceMapperImpl implements FSInterfaceMapper {

    @Override
    public FSInterfaceDto dtoFromContract(FSSaveInterfaceRequestType contract) {
        if ( contract == null ) {
            return null;
        }

        FSInterfaceDto fSInterfaceDto = new FSInterfaceDto();

        fSInterfaceDto.setId( contract.getId() );
        fSInterfaceDto.setWorkspaceId( contract.getWorkspaceId() );
        Set set = contract.getLabelIds();
        if ( set != null ) {
            fSInterfaceDto.setLabelIds( new LinkedHashSet( set ) );
        }
        Map map = contract.getCustomTags();
        if ( map != null ) {
            fSInterfaceDto.setCustomTags( new LinkedHashMap( map ) );
        }
        fSInterfaceDto.setAddress( addressTypeToAddressDto( contract.getAddress() ) );
        fSInterfaceDto.setPreRequestScripts( scriptBlockTypeListToScriptBlockDtoList( contract.getPreRequestScripts() ) );
        fSInterfaceDto.setTestScripts( scriptBlockTypeListToScriptBlockDtoList( contract.getTestScripts() ) );
        fSInterfaceDto.setBody( bodyTypeToBodyDto( contract.getBody() ) );
        fSInterfaceDto.setHeaders( keyValuePairTypeListToKeyValuePairDtoList( contract.getHeaders() ) );
        fSInterfaceDto.setParams( keyValuePairTypeListToKeyValuePairDtoList( contract.getParams() ) );
        fSInterfaceDto.setAuth( authTypeToAuthDto( contract.getAuth() ) );
        fSInterfaceDto.setTestAddress( addressTypeToAddressDto( contract.getTestAddress() ) );
        fSInterfaceDto.setDescription( contract.getDescription() );
        fSInterfaceDto.setOperationId( contract.getOperationId() );
        fSInterfaceDto.setOperationResponse( contract.getOperationResponse() );

        return fSInterfaceDto;
    }

    @Override
    public FSQueryInterfaceResponseType contractFromDto(FSInterfaceDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSQueryInterfaceResponseType fSQueryInterfaceResponseType = new FSQueryInterfaceResponseType();

        fSQueryInterfaceResponseType.setId( dto.getId() );
        fSQueryInterfaceResponseType.setName( dto.getName() );
        Map map = dto.getCustomTags();
        if ( map != null ) {
            fSQueryInterfaceResponseType.setCustomTags( new LinkedHashMap( map ) );
        }
        fSQueryInterfaceResponseType.setAddress( addressDtoToAddressType( dto.getAddress() ) );
        fSQueryInterfaceResponseType.setPreRequestScripts( scriptBlockDtoListToScriptBlockTypeList( dto.getPreRequestScripts() ) );
        fSQueryInterfaceResponseType.setTestScripts( scriptBlockDtoListToScriptBlockTypeList( dto.getTestScripts() ) );
        fSQueryInterfaceResponseType.setBody( bodyDtoToBodyType( dto.getBody() ) );
        fSQueryInterfaceResponseType.setHeaders( keyValuePairDtoListToKeyValuePairTypeList( dto.getHeaders() ) );
        fSQueryInterfaceResponseType.setParams( keyValuePairDtoListToKeyValuePairTypeList( dto.getParams() ) );
        fSQueryInterfaceResponseType.setAuth( authDtoToAuthType( dto.getAuth() ) );
        fSQueryInterfaceResponseType.setTestAddress( addressDtoToAddressType( dto.getTestAddress() ) );
        fSQueryInterfaceResponseType.setDescription( dto.getDescription() );
        fSQueryInterfaceResponseType.setOperationId( dto.getOperationId() );
        fSQueryInterfaceResponseType.setOperationResponse( dto.getOperationResponse() );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            fSQueryInterfaceResponseType.setLabelIds( new LinkedHashSet( set ) );
        }

        return fSQueryInterfaceResponseType;
    }

    @Override
    public FSInterfaceCollection daoFromDto(FSInterfaceDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSInterfaceCollection fSInterfaceCollection = new FSInterfaceCollection();

        fSInterfaceCollection.setId( dto.getId() );
        fSInterfaceCollection.setName( dto.getName() );
        fSInterfaceCollection.setWorkspaceId( dto.getWorkspaceId() );
        fSInterfaceCollection.setAddress( addressDtoToAddressDao( dto.getAddress() ) );
        fSInterfaceCollection.setPreRequestScripts( scriptBlockDtoListToScriptBlockDaoList( dto.getPreRequestScripts() ) );
        fSInterfaceCollection.setTestScripts( scriptBlockDtoListToScriptBlockDaoList( dto.getTestScripts() ) );
        fSInterfaceCollection.setBody( bodyDtoToBodyDao( dto.getBody() ) );
        fSInterfaceCollection.setHeaders( keyValuePairDtoListToKeyValuePairDaoList( dto.getHeaders() ) );
        fSInterfaceCollection.setParams( keyValuePairDtoListToKeyValuePairDaoList( dto.getParams() ) );
        fSInterfaceCollection.setAuth( authDtoToAuthDao( dto.getAuth() ) );
        fSInterfaceCollection.setTestAddress( addressDtoToAddressDao( dto.getTestAddress() ) );
        fSInterfaceCollection.setParentId( dto.getParentId() );
        fSInterfaceCollection.setParentNodeType( dto.getParentNodeType() );
        fSInterfaceCollection.setDescription( dto.getDescription() );
        Map map = dto.getCustomTags();
        if ( map != null ) {
            fSInterfaceCollection.setCustomTags( new LinkedHashMap( map ) );
        }
        fSInterfaceCollection.setOperationId( dto.getOperationId() );
        fSInterfaceCollection.setOperationResponse( dto.getOperationResponse() );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            fSInterfaceCollection.setLabelIds( new LinkedHashSet( set ) );
        }

        return fSInterfaceCollection;
    }

    @Override
    public FSInterfaceDto dtoFromDao(FSInterfaceCollection dao) {
        if ( dao == null ) {
            return null;
        }

        FSInterfaceDto fSInterfaceDto = new FSInterfaceDto();

        fSInterfaceDto.setId( dao.getId() );
        fSInterfaceDto.setName( dao.getName() );
        fSInterfaceDto.setWorkspaceId( dao.getWorkspaceId() );
        fSInterfaceDto.setParentId( dao.getParentId() );
        fSInterfaceDto.setParentNodeType( dao.getParentNodeType() );
        Set set = dao.getLabelIds();
        if ( set != null ) {
            fSInterfaceDto.setLabelIds( new LinkedHashSet( set ) );
        }
        Map map = dao.getCustomTags();
        if ( map != null ) {
            fSInterfaceDto.setCustomTags( new LinkedHashMap( map ) );
        }
        fSInterfaceDto.setAddress( addressDaoToAddressDto( dao.getAddress() ) );
        fSInterfaceDto.setPreRequestScripts( scriptBlockDaoListToScriptBlockDtoList( dao.getPreRequestScripts() ) );
        fSInterfaceDto.setTestScripts( scriptBlockDaoListToScriptBlockDtoList( dao.getTestScripts() ) );
        fSInterfaceDto.setBody( bodyDaoToBodyDto( dao.getBody() ) );
        fSInterfaceDto.setHeaders( keyValuePairDaoListToKeyValuePairDtoList( dao.getHeaders() ) );
        fSInterfaceDto.setParams( keyValuePairDaoListToKeyValuePairDtoList( dao.getParams() ) );
        fSInterfaceDto.setAuth( authDaoToAuthDto( dao.getAuth() ) );
        fSInterfaceDto.setTestAddress( addressDaoToAddressDto( dao.getTestAddress() ) );
        fSInterfaceDto.setDescription( dao.getDescription() );
        fSInterfaceDto.setOperationId( dao.getOperationId() );
        fSInterfaceDto.setOperationResponse( dao.getOperationResponse() );

        return fSInterfaceDto;
    }

    @Override
    public InterfaceItemDto ieItemFromFsItemDto(FSInterfaceDto dto) {
        if ( dto == null ) {
            return null;
        }

        InterfaceItemDto interfaceItemDto = new InterfaceItemDto();

        interfaceItemDto.setName( dto.getName() );
        interfaceItemDto.setAddress( dto.getAddress() );
        List list = dto.getPreRequestScripts();
        if ( list != null ) {
            interfaceItemDto.setPreRequestScripts( new ArrayList( list ) );
        }
        List list1 = dto.getTestScripts();
        if ( list1 != null ) {
            interfaceItemDto.setTestScripts( new ArrayList( list1 ) );
        }
        interfaceItemDto.setBody( dto.getBody() );
        List list2 = dto.getHeaders();
        if ( list2 != null ) {
            interfaceItemDto.setHeaders( new ArrayList( list2 ) );
        }
        List list3 = dto.getParams();
        if ( list3 != null ) {
            interfaceItemDto.setParams( new ArrayList( list3 ) );
        }
        interfaceItemDto.setAuth( dto.getAuth() );
        interfaceItemDto.setTestAddress( dto.getTestAddress() );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            interfaceItemDto.setLabelIds( new LinkedHashSet( set ) );
        }

        return interfaceItemDto;
    }

    @Override
    public FSInterfaceDto fsItemFromIeItemDto(InterfaceItemDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSInterfaceDto fSInterfaceDto = new FSInterfaceDto();

        fSInterfaceDto.setName( dto.getName() );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            fSInterfaceDto.setLabelIds( new LinkedHashSet( set ) );
        }
        fSInterfaceDto.setAddress( dto.getAddress() );
        List list = dto.getPreRequestScripts();
        if ( list != null ) {
            fSInterfaceDto.setPreRequestScripts( new ArrayList( list ) );
        }
        List list1 = dto.getTestScripts();
        if ( list1 != null ) {
            fSInterfaceDto.setTestScripts( new ArrayList( list1 ) );
        }
        fSInterfaceDto.setBody( dto.getBody() );
        List list2 = dto.getHeaders();
        if ( list2 != null ) {
            fSInterfaceDto.setHeaders( new ArrayList( list2 ) );
        }
        List list3 = dto.getParams();
        if ( list3 != null ) {
            fSInterfaceDto.setParams( new ArrayList( list3 ) );
        }
        fSInterfaceDto.setAuth( dto.getAuth() );
        fSInterfaceDto.setTestAddress( dto.getTestAddress() );

        return fSInterfaceDto;
    }

    protected AddressDto addressTypeToAddressDto(AddressType addressType) {
        if ( addressType == null ) {
            return null;
        }

        AddressDto addressDto = new AddressDto();

        addressDto.setMethod( addressType.getMethod() );
        addressDto.setEndpoint( addressType.getEndpoint() );

        return addressDto;
    }

    protected ScriptBlockDto scriptBlockTypeToScriptBlockDto(ScriptBlockType scriptBlockType) {
        if ( scriptBlockType == null ) {
            return null;
        }

        ScriptBlockDto scriptBlockDto = new ScriptBlockDto();

        scriptBlockDto.setType( scriptBlockType.getType() );
        scriptBlockDto.setIcon( scriptBlockType.getIcon() );
        scriptBlockDto.setLabel( scriptBlockType.getLabel() );
        scriptBlockDto.setValue( scriptBlockType.getValue() );
        scriptBlockDto.setDisabled( scriptBlockType.getDisabled() );
        scriptBlockDto.setDescription( scriptBlockType.getDescription() );

        return scriptBlockDto;
    }

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

        List list1 = new ArrayList( list.size() );
        for ( ScriptBlockType scriptBlockType : list ) {
            list1.add( scriptBlockTypeToScriptBlockDto( scriptBlockType ) );
        }

        return list1;
    }

    protected FormDataDto formDataTypeToFormDataDto(FormDataType formDataType) {
        if ( formDataType == null ) {
            return null;
        }

        FormDataDto formDataDto = new FormDataDto();

        formDataDto.setKey( formDataType.getKey() );
        formDataDto.setValue( formDataType.getValue() );
        formDataDto.setType( formDataType.getType() );

        return formDataDto;
    }

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

        List list1 = new ArrayList( list.size() );
        for ( FormDataType formDataType : list ) {
            list1.add( formDataTypeToFormDataDto( formDataType ) );
        }

        return list1;
    }

    protected BodyDto bodyTypeToBodyDto(BodyType bodyType) {
        if ( bodyType == null ) {
            return null;
        }

        BodyDto bodyDto = new BodyDto();

        bodyDto.setContentType( bodyType.getContentType() );
        bodyDto.setBody( bodyType.getBody() );
        bodyDto.setFormData( formDataTypeListToFormDataDtoList( bodyType.getFormData() ) );

        return bodyDto;
    }

    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 AuthDto authTypeToAuthDto(AuthType authType) {
        if ( authType == null ) {
            return null;
        }

        AuthDto authDto = new AuthDto();

        authDto.setAuthType( authType.getAuthType() );
        authDto.setAuthActive( authType.getAuthActive() );
        authDto.setToken( authType.getToken() );

        return authDto;
    }

    protected AddressType addressDtoToAddressType(AddressDto addressDto) {
        if ( addressDto == null ) {
            return null;
        }

        AddressType addressType = new AddressType();

        addressType.setMethod( addressDto.getMethod() );
        addressType.setEndpoint( addressDto.getEndpoint() );

        return addressType;
    }

    protected ScriptBlockType scriptBlockDtoToScriptBlockType(ScriptBlockDto scriptBlockDto) {
        if ( scriptBlockDto == null ) {
            return null;
        }

        ScriptBlockType scriptBlockType = new ScriptBlockType();

        scriptBlockType.setType( scriptBlockDto.getType() );
        scriptBlockType.setIcon( scriptBlockDto.getIcon() );
        scriptBlockType.setLabel( scriptBlockDto.getLabel() );
        scriptBlockType.setValue( scriptBlockDto.getValue() );
        scriptBlockType.setDescription( scriptBlockDto.getDescription() );
        scriptBlockType.setDisabled( scriptBlockDto.getDisabled() );

        return scriptBlockType;
    }

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

        List list1 = new ArrayList( list.size() );
        for ( ScriptBlockDto scriptBlockDto : list ) {
            list1.add( scriptBlockDtoToScriptBlockType( scriptBlockDto ) );
        }

        return list1;
    }

    protected FormDataType formDataDtoToFormDataType(FormDataDto formDataDto) {
        if ( formDataDto == null ) {
            return null;
        }

        FormDataType formDataType = new FormDataType();

        formDataType.setKey( formDataDto.getKey() );
        formDataType.setValue( formDataDto.getValue() );
        formDataType.setType( formDataDto.getType() );

        return formDataType;
    }

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

        List list1 = new ArrayList( list.size() );
        for ( FormDataDto formDataDto : list ) {
            list1.add( formDataDtoToFormDataType( formDataDto ) );
        }

        return list1;
    }

    protected BodyType bodyDtoToBodyType(BodyDto bodyDto) {
        if ( bodyDto == null ) {
            return null;
        }

        BodyType bodyType = new BodyType();

        bodyType.setContentType( bodyDto.getContentType() );
        bodyType.setBody( bodyDto.getBody() );
        bodyType.setFormData( formDataDtoListToFormDataTypeList( bodyDto.getFormData() ) );

        return bodyType;
    }

    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 AuthType authDtoToAuthType(AuthDto authDto) {
        if ( authDto == null ) {
            return null;
        }

        AuthType authType = new AuthType();

        authType.setAuthType( authDto.getAuthType() );
        authType.setAuthActive( authDto.getAuthActive() );
        authType.setToken( authDto.getToken() );

        return authType;
    }

    protected AddressDao addressDtoToAddressDao(AddressDto addressDto) {
        if ( addressDto == null ) {
            return null;
        }

        AddressDao addressDao = new AddressDao();

        addressDao.setMethod( addressDto.getMethod() );
        addressDao.setEndpoint( addressDto.getEndpoint() );

        return addressDao;
    }

    protected ScriptBlockDao scriptBlockDtoToScriptBlockDao(ScriptBlockDto scriptBlockDto) {
        if ( scriptBlockDto == null ) {
            return null;
        }

        ScriptBlockDao scriptBlockDao = new ScriptBlockDao();

        scriptBlockDao.setType( scriptBlockDto.getType() );
        scriptBlockDao.setIcon( scriptBlockDto.getIcon() );
        scriptBlockDao.setLabel( scriptBlockDto.getLabel() );
        scriptBlockDao.setValue( scriptBlockDto.getValue() );
        scriptBlockDao.setDescription( scriptBlockDto.getDescription() );
        scriptBlockDao.setDisabled( scriptBlockDto.getDisabled() );

        return scriptBlockDao;
    }

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

        List list1 = new ArrayList( list.size() );
        for ( ScriptBlockDto scriptBlockDto : list ) {
            list1.add( scriptBlockDtoToScriptBlockDao( scriptBlockDto ) );
        }

        return list1;
    }

    protected FormDataDao formDataDtoToFormDataDao(FormDataDto formDataDto) {
        if ( formDataDto == null ) {
            return null;
        }

        FormDataDao formDataDao = new FormDataDao();

        formDataDao.setKey( formDataDto.getKey() );
        formDataDao.setValue( formDataDto.getValue() );
        formDataDao.setType( formDataDto.getType() );

        return formDataDao;
    }

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

        List list1 = new ArrayList( list.size() );
        for ( FormDataDto formDataDto : list ) {
            list1.add( formDataDtoToFormDataDao( formDataDto ) );
        }

        return list1;
    }

    protected BodyDao bodyDtoToBodyDao(BodyDto bodyDto) {
        if ( bodyDto == null ) {
            return null;
        }

        BodyDao bodyDao = new BodyDao();

        bodyDao.setContentType( bodyDto.getContentType() );
        bodyDao.setBody( bodyDto.getBody() );
        bodyDao.setFormData( formDataDtoListToFormDataDaoList( bodyDto.getFormData() ) );

        return bodyDao;
    }

    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 AuthDao authDtoToAuthDao(AuthDto authDto) {
        if ( authDto == null ) {
            return null;
        }

        AuthDao authDao = new AuthDao();

        authDao.setAuthType( authDto.getAuthType() );
        authDao.setAuthActive( authDto.getAuthActive() );
        authDao.setToken( authDto.getToken() );

        return authDao;
    }

    protected AddressDto addressDaoToAddressDto(AddressDao addressDao) {
        if ( addressDao == null ) {
            return null;
        }

        AddressDto addressDto = new AddressDto();

        addressDto.setMethod( addressDao.getMethod() );
        addressDto.setEndpoint( addressDao.getEndpoint() );

        return addressDto;
    }

    protected ScriptBlockDto scriptBlockDaoToScriptBlockDto(ScriptBlockDao scriptBlockDao) {
        if ( scriptBlockDao == null ) {
            return null;
        }

        ScriptBlockDto scriptBlockDto = new ScriptBlockDto();

        scriptBlockDto.setType( scriptBlockDao.getType() );
        scriptBlockDto.setIcon( scriptBlockDao.getIcon() );
        scriptBlockDto.setLabel( scriptBlockDao.getLabel() );
        scriptBlockDto.setValue( scriptBlockDao.getValue() );
        scriptBlockDto.setDisabled( scriptBlockDao.getDisabled() );
        scriptBlockDto.setDescription( scriptBlockDao.getDescription() );

        return scriptBlockDto;
    }

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

        List list1 = new ArrayList( list.size() );
        for ( ScriptBlockDao scriptBlockDao : list ) {
            list1.add( scriptBlockDaoToScriptBlockDto( scriptBlockDao ) );
        }

        return list1;
    }

    protected FormDataDto formDataDaoToFormDataDto(FormDataDao formDataDao) {
        if ( formDataDao == null ) {
            return null;
        }

        FormDataDto formDataDto = new FormDataDto();

        formDataDto.setKey( formDataDao.getKey() );
        formDataDto.setValue( formDataDao.getValue() );
        formDataDto.setType( formDataDao.getType() );

        return formDataDto;
    }

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

        List list1 = new ArrayList( list.size() );
        for ( FormDataDao formDataDao : list ) {
            list1.add( formDataDaoToFormDataDto( formDataDao ) );
        }

        return list1;
    }

    protected BodyDto bodyDaoToBodyDto(BodyDao bodyDao) {
        if ( bodyDao == null ) {
            return null;
        }

        BodyDto bodyDto = new BodyDto();

        bodyDto.setContentType( bodyDao.getContentType() );
        bodyDto.setBody( bodyDao.getBody() );
        bodyDto.setFormData( formDataDaoListToFormDataDtoList( bodyDao.getFormData() ) );

        return bodyDto;
    }

    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 AuthDto authDaoToAuthDto(AuthDao authDao) {
        if ( authDao == null ) {
            return null;
        }

        AuthDto authDto = new AuthDto();

        authDto.setAuthType( authDao.getAuthType() );
        authDto.setAuthActive( authDao.getAuthActive() );
        authDto.setToken( authDao.getToken() );

        return authDto;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy