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

import com.qsoft.rs.sincoar.dto.TcustcompanyproductsPKDTO;
import com.qsoft.rs.sincoar.model.TcustcompanyproductsPK;
import javax.annotation.processing.Generated;

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

    @Override
    public TcustcompanyproductsPK getEntidad(TcustcompanyproductsPKDTO tcustcompanyproductsPK) {
        if ( tcustcompanyproductsPK == null ) {
            return null;
        }

        TcustcompanyproductsPK tcustcompanyproductsPK1 = new TcustcompanyproductsPK();

        if ( tcustcompanyproductsPK.getPersoncode() != null ) {
            tcustcompanyproductsPK1.setPersoncode( tcustcompanyproductsPK.getPersoncode() );
        }
        tcustcompanyproductsPK1.setDateto( tcustcompanyproductsPK.getDateto() );
        if ( tcustcompanyproductsPK.getProductsequence() != null ) {
            tcustcompanyproductsPK1.setProductsequence( tcustcompanyproductsPK.getProductsequence().shortValue() );
        }

        return tcustcompanyproductsPK1;
    }

    @Override
    public TcustcompanyproductsPKDTO getDto(TcustcompanyproductsPK tcustcompanyproductsPK) {
        if ( tcustcompanyproductsPK == null ) {
            return null;
        }

        TcustcompanyproductsPKDTO tcustcompanyproductsPKDTO = new TcustcompanyproductsPKDTO();

        tcustcompanyproductsPKDTO.setPersoncode( (int) tcustcompanyproductsPK.getPersoncode() );
        tcustcompanyproductsPKDTO.setDateto( tcustcompanyproductsPK.getDateto() );
        tcustcompanyproductsPKDTO.setProductsequence( (int) tcustcompanyproductsPK.getProductsequence() );

        return tcustcompanyproductsPKDTO;
    }
}
