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

import com.qsoft.rs.sincoar.dto.TgeneaccountingdatebranchPKDTO;
import com.qsoft.rs.sincoar.model.TgeneaccountingdatebranchPK;
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 TgeneaccountingdatebranchPKMapperImpl implements TgeneaccountingdatebranchPKMapper {

    @Override
    public TgeneaccountingdatebranchPK getEntidad(TgeneaccountingdatebranchPKDTO tgeneaccountingdatebranchPK) {
        if ( tgeneaccountingdatebranchPK == null ) {
            return null;
        }

        TgeneaccountingdatebranchPK tgeneaccountingdatebranchPK1 = new TgeneaccountingdatebranchPK();

        if ( tgeneaccountingdatebranchPK.getBranchcode() != null ) {
            tgeneaccountingdatebranchPK1.setBranchcode( tgeneaccountingdatebranchPK.getBranchcode().shortValue() );
        }
        if ( tgeneaccountingdatebranchPK.getCompanycode() != null ) {
            tgeneaccountingdatebranchPK1.setCompanycode( tgeneaccountingdatebranchPK.getCompanycode() );
        }

        return tgeneaccountingdatebranchPK1;
    }

    @Override
    public TgeneaccountingdatebranchPKDTO getDto(TgeneaccountingdatebranchPK tgeneaccountingdatebranchPK) {
        if ( tgeneaccountingdatebranchPK == null ) {
            return null;
        }

        TgeneaccountingdatebranchPKDTO tgeneaccountingdatebranchPKDTO = new TgeneaccountingdatebranchPKDTO();

        tgeneaccountingdatebranchPKDTO.setBranchcode( (int) tgeneaccountingdatebranchPK.getBranchcode() );
        tgeneaccountingdatebranchPKDTO.setCompanycode( (int) tgeneaccountingdatebranchPK.getCompanycode() );

        return tgeneaccountingdatebranchPKDTO;
    }
}
