package com.qsoft.rs.sincoar.dominio.mapper;

import com.qsoft.rs.sincoar.dto.MgvAllConnectionsDTO;
import com.qsoft.rs.sincoar.model.MgvAllConnections;
import java.math.BigInteger;
import javax.annotation.processing.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2022-09-02T16:14:50-0500",
    comments = "version: 1.5.2.Final, compiler: javac, environment: Java 17.0.4 (Private Build)"
)
public class MgvAllConnectionsMapperImpl implements MgvAllConnectionsMapper {

    @Override
    public MgvAllConnections getEntidad(MgvAllConnectionsDTO mgvAllConnections) {
        if ( mgvAllConnections == null ) {
            return null;
        }

        MgvAllConnections mgvAllConnections1 = new MgvAllConnections();

        if ( mgvAllConnections.getProjectId() != null ) {
            mgvAllConnections1.setProjectId( BigInteger.valueOf( mgvAllConnections.getProjectId() ) );
        }
        mgvAllConnections1.setProjectName( mgvAllConnections.getProjectName() );
        if ( mgvAllConnections.getConnectionId() != null ) {
            mgvAllConnections1.setConnectionId( BigInteger.valueOf( mgvAllConnections.getConnectionId() ) );
        }
        mgvAllConnections1.setHost( mgvAllConnections.getHost() );
        if ( mgvAllConnections.getPort() != null ) {
            mgvAllConnections1.setPort( BigInteger.valueOf( mgvAllConnections.getPort() ) );
        }
        mgvAllConnections1.setUsername( mgvAllConnections.getUsername() );
        mgvAllConnections1.setDburl( mgvAllConnections.getDburl() );

        return mgvAllConnections1;
    }

    @Override
    public MgvAllConnectionsDTO getDto(MgvAllConnections mgvAllConnections) {
        if ( mgvAllConnections == null ) {
            return null;
        }

        MgvAllConnectionsDTO mgvAllConnectionsDTO = new MgvAllConnectionsDTO();

        if ( mgvAllConnections.getProjectId() != null ) {
            mgvAllConnectionsDTO.setProjectId( mgvAllConnections.getProjectId().intValue() );
        }
        mgvAllConnectionsDTO.setProjectName( mgvAllConnections.getProjectName() );
        if ( mgvAllConnections.getConnectionId() != null ) {
            mgvAllConnectionsDTO.setConnectionId( mgvAllConnections.getConnectionId().intValue() );
        }
        mgvAllConnectionsDTO.setHost( mgvAllConnections.getHost() );
        if ( mgvAllConnections.getPort() != null ) {
            mgvAllConnectionsDTO.setPort( mgvAllConnections.getPort().intValue() );
        }
        mgvAllConnectionsDTO.setUsername( mgvAllConnections.getUsername() );
        mgvAllConnectionsDTO.setDburl( mgvAllConnections.getDburl() );

        return mgvAllConnectionsDTO;
    }
}
