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

import com.qsoft.rs.sincoar.dto.TgenebranchPKDTO;
import com.qsoft.rs.sincoar.model.TgenebranchPK;
import javax.annotation.processing.Generated;

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

    @Override
    public TgenebranchPK getEntidad(TgenebranchPKDTO tgenebranchPK) {
        if ( tgenebranchPK == null ) {
            return null;
        }

        TgenebranchPK tgenebranchPK1 = new TgenebranchPK();

        if ( tgenebranchPK.getBranchcode() != null ) {
            tgenebranchPK1.setBranchcode( tgenebranchPK.getBranchcode().shortValue() );
        }
        if ( tgenebranchPK.getCompanycode() != null ) {
            tgenebranchPK1.setCompanycode( tgenebranchPK.getCompanycode() );
        }

        return tgenebranchPK1;
    }

    @Override
    public TgenebranchPKDTO getDto(TgenebranchPK tgenebranchPK) {
        if ( tgenebranchPK == null ) {
            return null;
        }

        TgenebranchPKDTO tgenebranchPKDTO = new TgenebranchPKDTO();

        tgenebranchPKDTO.setBranchcode( (int) tgenebranchPK.getBranchcode() );
        tgenebranchPKDTO.setCompanycode( (int) tgenebranchPK.getCompanycode() );

        return tgenebranchPKDTO;
    }
}
