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

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

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

    @Override
    public MgvAllCatalogs getEntidad(MgvAllCatalogsDTO mgvAllCatalogs) {
        if ( mgvAllCatalogs == null ) {
            return null;
        }

        MgvAllCatalogs mgvAllCatalogs1 = new MgvAllCatalogs();

        if ( mgvAllCatalogs.getProjectId() != null ) {
            mgvAllCatalogs1.setProjectId( BigInteger.valueOf( mgvAllCatalogs.getProjectId() ) );
        }
        mgvAllCatalogs1.setProjectName( mgvAllCatalogs.getProjectName() );
        if ( mgvAllCatalogs.getConnectionId() != null ) {
            mgvAllCatalogs1.setConnectionId( BigInteger.valueOf( mgvAllCatalogs.getConnectionId() ) );
        }
        mgvAllCatalogs1.setHost( mgvAllCatalogs.getHost() );
        if ( mgvAllCatalogs.getPort() != null ) {
            mgvAllCatalogs1.setPort( BigInteger.valueOf( mgvAllCatalogs.getPort() ) );
        }
        mgvAllCatalogs1.setUsername( mgvAllCatalogs.getUsername() );
        mgvAllCatalogs1.setDburl( mgvAllCatalogs.getDburl() );
        if ( mgvAllCatalogs.getCatalogId() != null ) {
            mgvAllCatalogs1.setCatalogId( BigInteger.valueOf( mgvAllCatalogs.getCatalogId() ) );
        }
        mgvAllCatalogs1.setCatalogName( mgvAllCatalogs.getCatalogName() );

        return mgvAllCatalogs1;
    }

    @Override
    public MgvAllCatalogsDTO getDto(MgvAllCatalogs mgvAllCatalogs) {
        if ( mgvAllCatalogs == null ) {
            return null;
        }

        MgvAllCatalogsDTO mgvAllCatalogsDTO = new MgvAllCatalogsDTO();

        if ( mgvAllCatalogs.getProjectId() != null ) {
            mgvAllCatalogsDTO.setProjectId( mgvAllCatalogs.getProjectId().intValue() );
        }
        mgvAllCatalogsDTO.setProjectName( mgvAllCatalogs.getProjectName() );
        if ( mgvAllCatalogs.getConnectionId() != null ) {
            mgvAllCatalogsDTO.setConnectionId( mgvAllCatalogs.getConnectionId().intValue() );
        }
        mgvAllCatalogsDTO.setHost( mgvAllCatalogs.getHost() );
        if ( mgvAllCatalogs.getPort() != null ) {
            mgvAllCatalogsDTO.setPort( mgvAllCatalogs.getPort().intValue() );
        }
        mgvAllCatalogsDTO.setUsername( mgvAllCatalogs.getUsername() );
        mgvAllCatalogsDTO.setDburl( mgvAllCatalogs.getDburl() );
        if ( mgvAllCatalogs.getCatalogId() != null ) {
            mgvAllCatalogsDTO.setCatalogId( mgvAllCatalogs.getCatalogId().intValue() );
        }
        mgvAllCatalogsDTO.setCatalogName( mgvAllCatalogs.getCatalogName() );

        return mgvAllCatalogsDTO;
    }
}
