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

import com.qsoft.rs.sincoar.dto.TcustcompanybranchPKDTO;
import com.qsoft.rs.sincoar.model.TcustcompanybranchPK;
import javax.annotation.processing.Generated;

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

    @Override
    public TcustcompanybranchPK getEntidad(TcustcompanybranchPKDTO tcustcompanybranchPK) {
        if ( tcustcompanybranchPK == null ) {
            return null;
        }

        TcustcompanybranchPK tcustcompanybranchPK1 = new TcustcompanybranchPK();

        if ( tcustcompanybranchPK.getPersoncode() != null ) {
            tcustcompanybranchPK1.setPersoncode( tcustcompanybranchPK.getPersoncode() );
        }
        tcustcompanybranchPK1.setDateto( tcustcompanybranchPK.getDateto() );
        if ( tcustcompanybranchPK.getBranchsequence() != null ) {
            tcustcompanybranchPK1.setBranchsequence( tcustcompanybranchPK.getBranchsequence().shortValue() );
        }

        return tcustcompanybranchPK1;
    }

    @Override
    public TcustcompanybranchPKDTO getDto(TcustcompanybranchPK tcustcompanybranchPK) {
        if ( tcustcompanybranchPK == null ) {
            return null;
        }

        TcustcompanybranchPKDTO tcustcompanybranchPKDTO = new TcustcompanybranchPKDTO();

        tcustcompanybranchPKDTO.setPersoncode( (int) tcustcompanybranchPK.getPersoncode() );
        tcustcompanybranchPKDTO.setDateto( tcustcompanybranchPK.getDateto() );
        tcustcompanybranchPKDTO.setBranchsequence( (int) tcustcompanybranchPK.getBranchsequence() );

        return tcustcompanybranchPKDTO;
    }
}
