com.arextest.web.model.mapper.ManualReportCaseMapperImpl 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.AuthType;
import com.arextest.web.model.contract.contracts.filesystem.BodyType;
import com.arextest.web.model.contract.contracts.filesystem.FormDataType;
import com.arextest.web.model.contract.contracts.manualreport.ReportCaseType;
import com.arextest.web.model.dao.mongodb.ManualReportCaseCollection;
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.AuthDto;
import com.arextest.web.model.dto.filesystem.BodyDto;
import com.arextest.web.model.dto.filesystem.FSCaseDto;
import com.arextest.web.model.dto.filesystem.FormDataDto;
import com.arextest.web.model.dto.filesystem.ScriptBlockDto;
import com.arextest.web.model.dto.manualreport.ManualReportCaseDto;
import com.arextest.web.model.dto.manualreport.SaveManualReportCaseDto;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-09-26T09:42:05+0000",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 11.0.24 (Eclipse Adoptium)"
)
public class ManualReportCaseMapperImpl implements ManualReportCaseMapper {
@Override
public List dtoFromFsCaseDto(List dtos) {
if ( dtos == null ) {
return null;
}
List list = new ArrayList( dtos.size() );
for ( FSCaseDto fSCaseDto : dtos ) {
list.add( fSCaseDtoToManualReportCaseDto( fSCaseDto ) );
}
return list;
}
@Override
public List daoFromDtoList(List dtos) {
if ( dtos == null ) {
return null;
}
List list = new ArrayList( dtos.size() );
for ( ManualReportCaseDto manualReportCaseDto : dtos ) {
list.add( manualReportCaseDtoToManualReportCaseCollection( manualReportCaseDto ) );
}
return list;
}
@Override
public ManualReportCaseCollection daoFromDto(SaveManualReportCaseDto dto) {
if ( dto == null ) {
return null;
}
ManualReportCaseCollection manualReportCaseCollection = new ManualReportCaseCollection();
manualReportCaseCollection.setBaseMsg( compressMsg( dto.getBaseMsg() ) );
manualReportCaseCollection.setTestMsg( compressMsg( dto.getTestMsg() ) );
manualReportCaseCollection.setId( dto.getId() );
manualReportCaseCollection.setLogs( map( dto.getLogs() ) );
manualReportCaseCollection.setDiffResultCode( dto.getDiffResultCode() );
return manualReportCaseCollection;
}
@Override
public ReportCaseType contractFromDto(ManualReportCaseDto dto) {
if ( dto == null ) {
return null;
}
ReportCaseType reportCaseType = new ReportCaseType();
reportCaseType.setId( dto.getId() );
reportCaseType.setPreRequestScripts( scriptBlockDtoListToScriptBlockTypeList( dto.getPreRequestScripts() ) );
reportCaseType.setTestScripts( scriptBlockDtoListToScriptBlockTypeList( dto.getTestScripts() ) );
reportCaseType.setBody( bodyDaoToBodyType( dto.getBody() ) );
reportCaseType.setHeaders( keyValuePairDaoListToKeyValuePairTypeList( dto.getHeaders() ) );
reportCaseType.setParams( keyValuePairDaoListToKeyValuePairTypeList( dto.getParams() ) );
reportCaseType.setAuth( authDaoToAuthType( dto.getAuth() ) );
reportCaseType.setPlanItemId( dto.getPlanItemId() );
reportCaseType.setCaseName( dto.getCaseName() );
reportCaseType.setBaseMsg( dto.getBaseMsg() );
reportCaseType.setTestMsg( dto.getTestMsg() );
reportCaseType.setLogs( map( dto.getLogs() ) );
reportCaseType.setDiffResultCode( dto.getDiffResultCode() );
return reportCaseType;
}
@Override
public ManualReportCaseDto dtoFromDao(ManualReportCaseCollection dao) {
if ( dao == null ) {
return null;
}
ManualReportCaseDto manualReportCaseDto = new ManualReportCaseDto();
manualReportCaseDto.setId( dao.getId() );
manualReportCaseDto.setPreRequestScripts( scriptBlockDaoListToScriptBlockDtoList( dao.getPreRequestScripts() ) );
manualReportCaseDto.setTestScripts( scriptBlockDaoListToScriptBlockDtoList( dao.getTestScripts() ) );
manualReportCaseDto.setBody( dao.getBody() );
List list2 = dao.getHeaders();
if ( list2 != null ) {
manualReportCaseDto.setHeaders( new ArrayList( list2 ) );
}
List list3 = dao.getParams();
if ( list3 != null ) {
manualReportCaseDto.setParams( new ArrayList( list3 ) );
}
manualReportCaseDto.setAuth( dao.getAuth() );
manualReportCaseDto.setPlanItemId( dao.getPlanItemId() );
manualReportCaseDto.setCaseName( dao.getCaseName() );
manualReportCaseDto.setBaseMsg( dao.getBaseMsg() );
manualReportCaseDto.setTestMsg( dao.getTestMsg() );
manualReportCaseDto.setLogs( map( dao.getLogs() ) );
manualReportCaseDto.setDiffResultCode( dao.getDiffResultCode() );
return manualReportCaseDto;
}
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 ManualReportCaseDto fSCaseDtoToManualReportCaseDto(FSCaseDto fSCaseDto) {
if ( fSCaseDto == null ) {
return null;
}
ManualReportCaseDto manualReportCaseDto = new ManualReportCaseDto();
manualReportCaseDto.setId( fSCaseDto.getId() );
List list = fSCaseDto.getPreRequestScripts();
if ( list != null ) {
manualReportCaseDto.setPreRequestScripts( new ArrayList( list ) );
}
List list1 = fSCaseDto.getTestScripts();
if ( list1 != null ) {
manualReportCaseDto.setTestScripts( new ArrayList( list1 ) );
}
manualReportCaseDto.setBody( bodyDtoToBodyDao( fSCaseDto.getBody() ) );
manualReportCaseDto.setHeaders( keyValuePairDtoListToKeyValuePairDaoList( fSCaseDto.getHeaders() ) );
manualReportCaseDto.setParams( keyValuePairDtoListToKeyValuePairDaoList( fSCaseDto.getParams() ) );
manualReportCaseDto.setAuth( authDtoToAuthDao( fSCaseDto.getAuth() ) );
return manualReportCaseDto;
}
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 ManualReportCaseCollection manualReportCaseDtoToManualReportCaseCollection(ManualReportCaseDto manualReportCaseDto) {
if ( manualReportCaseDto == null ) {
return null;
}
ManualReportCaseCollection manualReportCaseCollection = new ManualReportCaseCollection();
manualReportCaseCollection.setId( manualReportCaseDto.getId() );
manualReportCaseCollection.setPreRequestScripts( scriptBlockDtoListToScriptBlockDaoList( manualReportCaseDto.getPreRequestScripts() ) );
manualReportCaseCollection.setTestScripts( scriptBlockDtoListToScriptBlockDaoList( manualReportCaseDto.getTestScripts() ) );
manualReportCaseCollection.setBody( manualReportCaseDto.getBody() );
List list2 = manualReportCaseDto.getHeaders();
if ( list2 != null ) {
manualReportCaseCollection.setHeaders( new ArrayList( list2 ) );
}
List list3 = manualReportCaseDto.getParams();
if ( list3 != null ) {
manualReportCaseCollection.setParams( new ArrayList( list3 ) );
}
manualReportCaseCollection.setAuth( manualReportCaseDto.getAuth() );
manualReportCaseCollection.setPlanItemId( manualReportCaseDto.getPlanItemId() );
manualReportCaseCollection.setCaseName( manualReportCaseDto.getCaseName() );
manualReportCaseCollection.setBaseMsg( manualReportCaseDto.getBaseMsg() );
manualReportCaseCollection.setTestMsg( manualReportCaseDto.getTestMsg() );
manualReportCaseCollection.setLogs( map( manualReportCaseDto.getLogs() ) );
manualReportCaseCollection.setDiffResultCode( manualReportCaseDto.getDiffResultCode() );
return manualReportCaseCollection;
}
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 formDataDaoToFormDataType(FormDataDao formDataDao) {
if ( formDataDao == null ) {
return null;
}
FormDataType formDataType = new FormDataType();
formDataType.setKey( formDataDao.getKey() );
formDataType.setValue( formDataDao.getValue() );
formDataType.setType( formDataDao.getType() );
return formDataType;
}
protected List formDataDaoListToFormDataTypeList(List list) {
if ( list == null ) {
return null;
}
List list1 = new ArrayList( list.size() );
for ( FormDataDao formDataDao : list ) {
list1.add( formDataDaoToFormDataType( formDataDao ) );
}
return list1;
}
protected BodyType bodyDaoToBodyType(BodyDao bodyDao) {
if ( bodyDao == null ) {
return null;
}
BodyType bodyType = new BodyType();
bodyType.setContentType( bodyDao.getContentType() );
bodyType.setBody( bodyDao.getBody() );
bodyType.setFormData( formDataDaoListToFormDataTypeList( bodyDao.getFormData() ) );
return bodyType;
}
protected KeyValuePairType keyValuePairDaoToKeyValuePairType(KeyValuePairDao keyValuePairDao) {
if ( keyValuePairDao == null ) {
return null;
}
KeyValuePairType keyValuePairType = new KeyValuePairType();
keyValuePairType.setKey( keyValuePairDao.getKey() );
keyValuePairType.setValue( keyValuePairDao.getValue() );
keyValuePairType.setActive( keyValuePairDao.getActive() );
return keyValuePairType;
}
protected List keyValuePairDaoListToKeyValuePairTypeList(List list) {
if ( list == null ) {
return null;
}
List list1 = new ArrayList( list.size() );
for ( KeyValuePairDao keyValuePairDao : list ) {
list1.add( keyValuePairDaoToKeyValuePairType( keyValuePairDao ) );
}
return list1;
}
protected AuthType authDaoToAuthType(AuthDao authDao) {
if ( authDao == null ) {
return null;
}
AuthType authType = new AuthType();
authType.setAuthType( authDao.getAuthType() );
authType.setAuthActive( authDao.getAuthActive() );
authType.setToken( authDao.getToken() );
return authType;
}
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;
}
}