com.arextest.config.mapper.InstancesMapperImpl Maven / Gradle / Ivy
package com.arextest.config.mapper;
import com.arextest.config.model.dao.config.InstancesCollection;
import com.arextest.config.model.dto.application.InstancesConfiguration;
import com.arextest.config.model.vo.AgentRemoteConfigurationRequest;
import com.arextest.config.model.vo.AgentStatusRequest;
import java.util.HashMap;
import java.util.Map;
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 InstancesMapperImpl implements InstancesMapper {
@Override
public InstancesConfiguration dtoFromDao(InstancesCollection dao) {
if ( dao == null ) {
return null;
}
InstancesConfiguration instancesConfiguration = new InstancesConfiguration();
instancesConfiguration.setId( dao.getId() );
instancesConfiguration.setAppId( dao.getAppId() );
instancesConfiguration.setRecordVersion( dao.getRecordVersion() );
instancesConfiguration.setHost( dao.getHost() );
instancesConfiguration.setDataUpdateTime( dao.getDataUpdateTime() );
instancesConfiguration.setAgentStatus( dao.getAgentStatus() );
Map map = dao.getTags();
if ( map != null ) {
instancesConfiguration.setTags( new HashMap( map ) );
}
else {
instancesConfiguration.setTags( null );
}
Map map1 = dao.getSystemEnv();
if ( map1 != null ) {
instancesConfiguration.setSystemEnv( new HashMap( map1 ) );
}
else {
instancesConfiguration.setSystemEnv( null );
}
Map map2 = dao.getSystemProperties();
if ( map2 != null ) {
instancesConfiguration.setSystemProperties( new HashMap( map2 ) );
}
else {
instancesConfiguration.setSystemProperties( null );
}
Map map3 = dao.getExtendField();
if ( map3 != null ) {
instancesConfiguration.setExtendField( new HashMap( map3 ) );
}
else {
instancesConfiguration.setExtendField( null );
}
instancesConfiguration.setModifiedTime( dao.getDataChangeUpdateTime() == null ? null : new java.sql.Timestamp(dao.getDataChangeUpdateTime()) );
return instancesConfiguration;
}
@Override
public InstancesCollection daoFromDto(InstancesConfiguration dto) {
if ( dto == null ) {
return null;
}
InstancesCollection instancesCollection = new InstancesCollection();
instancesCollection.setId( dto.getId() );
instancesCollection.setAppId( dto.getAppId() );
instancesCollection.setHost( dto.getHost() );
instancesCollection.setRecordVersion( dto.getRecordVersion() );
instancesCollection.setDataUpdateTime( dto.getDataUpdateTime() );
instancesCollection.setAgentStatus( dto.getAgentStatus() );
Map map = dto.getTags();
if ( map != null ) {
instancesCollection.setTags( new HashMap( map ) );
}
else {
instancesCollection.setTags( null );
}
Map map1 = dto.getSystemEnv();
if ( map1 != null ) {
instancesCollection.setSystemEnv( new HashMap( map1 ) );
}
else {
instancesCollection.setSystemEnv( null );
}
Map map2 = dto.getSystemProperties();
if ( map2 != null ) {
instancesCollection.setSystemProperties( new HashMap( map2 ) );
}
else {
instancesCollection.setSystemProperties( null );
}
Map map3 = dto.getExtendField();
if ( map3 != null ) {
instancesCollection.setExtendField( new HashMap( map3 ) );
}
else {
instancesCollection.setExtendField( null );
}
return instancesCollection;
}
@Override
public InstancesConfiguration dtoFromContract(AgentRemoteConfigurationRequest contract) {
if ( contract == null ) {
return null;
}
InstancesConfiguration instancesConfiguration = new InstancesConfiguration();
instancesConfiguration.setTags( extractTags( contract.getSystemProperties() ) );
instancesConfiguration.setStatus( contract.getStatus() );
instancesConfiguration.setAppId( contract.getAppId() );
instancesConfiguration.setRecordVersion( contract.getRecordVersion() );
instancesConfiguration.setHost( contract.getHost() );
instancesConfiguration.setAgentStatus( contract.getAgentStatus() );
Map map1 = contract.getSystemEnv();
if ( map1 != null ) {
instancesConfiguration.setSystemEnv( new HashMap( map1 ) );
}
else {
instancesConfiguration.setSystemEnv( null );
}
Map map2 = contract.getSystemProperties();
if ( map2 != null ) {
instancesConfiguration.setSystemProperties( new HashMap( map2 ) );
}
else {
instancesConfiguration.setSystemProperties( null );
}
return instancesConfiguration;
}
@Override
public InstancesConfiguration dtoFromContract(AgentStatusRequest request) {
if ( request == null ) {
return null;
}
InstancesConfiguration instancesConfiguration = new InstancesConfiguration();
instancesConfiguration.setAppId( request.getAppId() );
instancesConfiguration.setHost( request.getHost() );
instancesConfiguration.setAgentStatus( request.getAgentStatus() );
return instancesConfiguration;
}
}