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

import com.qsoft.rs.sincoar.dto.MdProjectsDTO;
import com.qsoft.rs.sincoar.model.MdProjects;
import java.math.BigDecimal;
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 MdProjectsMapperImpl implements MdProjectsMapper {

    @Override
    public MdProjects getEntidad(MdProjectsDTO mdProjects) {
        if ( mdProjects == null ) {
            return null;
        }

        MdProjects mdProjects1 = new MdProjects();

        if ( mdProjects.getId() != null ) {
            mdProjects1.setId( BigDecimal.valueOf( mdProjects.getId() ) );
        }
        mdProjects1.setProjectName( mdProjects.getProjectName() );
        mdProjects1.setComments( mdProjects.getComments() );
        if ( mdProjects.getSecurityGroupId() != null ) {
            mdProjects1.setSecurityGroupId( BigInteger.valueOf( mdProjects.getSecurityGroupId() ) );
        }
        mdProjects1.setCreatedOn( mdProjects.getCreatedOn() );
        mdProjects1.setCreatedBy( mdProjects.getCreatedBy() );
        mdProjects1.setLastUpdatedOn( mdProjects.getLastUpdatedOn() );
        mdProjects1.setLastUpdatedBy( mdProjects.getLastUpdatedBy() );

        return mdProjects1;
    }

    @Override
    public MdProjectsDTO getDto(MdProjects mdProjects) {
        if ( mdProjects == null ) {
            return null;
        }

        MdProjectsDTO mdProjectsDTO = new MdProjectsDTO();

        if ( mdProjects.getId() != null ) {
            mdProjectsDTO.setId( mdProjects.getId().intValue() );
        }
        mdProjectsDTO.setProjectName( mdProjects.getProjectName() );
        mdProjectsDTO.setComments( mdProjects.getComments() );
        if ( mdProjects.getSecurityGroupId() != null ) {
            mdProjectsDTO.setSecurityGroupId( mdProjects.getSecurityGroupId().intValue() );
        }
        mdProjectsDTO.setCreatedOn( mdProjects.getCreatedOn() );
        mdProjectsDTO.setCreatedBy( mdProjects.getCreatedBy() );
        mdProjectsDTO.setLastUpdatedOn( mdProjects.getLastUpdatedOn() );
        mdProjectsDTO.setLastUpdatedBy( mdProjects.getLastUpdatedBy() );

        return mdProjectsDTO;
    }
}
