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

import com.qsoft.rs.sincoar.dto.TgeneofficePKDTO;
import com.qsoft.rs.sincoar.model.TgeneofficePK;
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 TgeneofficePKMapperImpl implements TgeneofficePKMapper {

    @Override
    public TgeneofficePK getEntidad(TgeneofficePKDTO tgeneofficePK) {
        if ( tgeneofficePK == null ) {
            return null;
        }

        TgeneofficePK tgeneofficePK1 = new TgeneofficePK();

        if ( tgeneofficePK.getOfficecode() != null ) {
            tgeneofficePK1.setOfficecode( tgeneofficePK.getOfficecode().shortValue() );
        }
        if ( tgeneofficePK.getBranchcode() != null ) {
            tgeneofficePK1.setBranchcode( tgeneofficePK.getBranchcode().shortValue() );
        }
        if ( tgeneofficePK.getCompanycode() != null ) {
            tgeneofficePK1.setCompanycode( tgeneofficePK.getCompanycode() );
        }

        return tgeneofficePK1;
    }

    @Override
    public TgeneofficePKDTO getDto(TgeneofficePK tgeneofficePK) {
        if ( tgeneofficePK == null ) {
            return null;
        }

        TgeneofficePKDTO tgeneofficePKDTO = new TgeneofficePKDTO();

        tgeneofficePKDTO.setOfficecode( (int) tgeneofficePK.getOfficecode() );
        tgeneofficePKDTO.setBranchcode( (int) tgeneofficePK.getBranchcode() );
        tgeneofficePKDTO.setCompanycode( (int) tgeneofficePK.getCompanycode() );

        return tgeneofficePKDTO;
    }
}
