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

import com.qsoft.rs.sincoar.dto.TcustpersonaddressPKDTO;
import com.qsoft.rs.sincoar.model.TcustpersonaddressPK;
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 TcustpersonaddressPKMapperImpl implements TcustpersonaddressPKMapper {

    @Override
    public TcustpersonaddressPK getEntidad(TcustpersonaddressPKDTO tcustpersonaddressPK) {
        if ( tcustpersonaddressPK == null ) {
            return null;
        }

        TcustpersonaddressPK tcustpersonaddressPK1 = new TcustpersonaddressPK();

        if ( tcustpersonaddressPK.getPersoncode() != null ) {
            tcustpersonaddressPK1.setPersoncode( tcustpersonaddressPK.getPersoncode() );
        }
        if ( tcustpersonaddressPK.getAddressnumber() != null ) {
            tcustpersonaddressPK1.setAddressnumber( tcustpersonaddressPK.getAddressnumber().shortValue() );
        }
        tcustpersonaddressPK1.setDateto( tcustpersonaddressPK.getDateto() );

        return tcustpersonaddressPK1;
    }

    @Override
    public TcustpersonaddressPKDTO getDto(TcustpersonaddressPK tcustpersonaddressPK) {
        if ( tcustpersonaddressPK == null ) {
            return null;
        }

        TcustpersonaddressPKDTO tcustpersonaddressPKDTO = new TcustpersonaddressPKDTO();

        tcustpersonaddressPKDTO.setPersoncode( (int) tcustpersonaddressPK.getPersoncode() );
        tcustpersonaddressPKDTO.setAddressnumber( (int) tcustpersonaddressPK.getAddressnumber() );
        tcustpersonaddressPKDTO.setDateto( tcustpersonaddressPK.getDateto() );

        return tcustpersonaddressPKDTO;
    }
}
