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

import com.qsoft.rs.sincoar.dto.TgenechargesPKDTO;
import com.qsoft.rs.sincoar.model.TgenechargesPK;
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 TgenechargesPKMapperImpl implements TgenechargesPKMapper {

    @Override
    public TgenechargesPK getEntidad(TgenechargesPKDTO tgenechargesPK) {
        if ( tgenechargesPK == null ) {
            return null;
        }

        TgenechargesPK tgenechargesPK1 = new TgenechargesPK();

        tgenechargesPK1.setBalancetype( tgenechargesPK.getBalancetype() );
        tgenechargesPK1.setBalancegroup( tgenechargesPK.getBalancegroup() );
        tgenechargesPK1.setModulecode( tgenechargesPK.getModulecode() );
        tgenechargesPK1.setStatuscode( tgenechargesPK.getStatuscode() );
        if ( tgenechargesPK.getCompanycode() != null ) {
            tgenechargesPK1.setCompanycode( tgenechargesPK.getCompanycode() );
        }
        tgenechargesPK1.setCurrencycode( tgenechargesPK.getCurrencycode() );
        if ( tgenechargesPK.getRatesequence() != null ) {
            tgenechargesPK1.setRatesequence( tgenechargesPK.getRatesequence().shortValue() );
        }

        return tgenechargesPK1;
    }

    @Override
    public TgenechargesPKDTO getDto(TgenechargesPK tgenechargesPK) {
        if ( tgenechargesPK == null ) {
            return null;
        }

        TgenechargesPKDTO tgenechargesPKDTO = new TgenechargesPKDTO();

        tgenechargesPKDTO.setBalancetype( tgenechargesPK.getBalancetype() );
        tgenechargesPKDTO.setBalancegroup( tgenechargesPK.getBalancegroup() );
        tgenechargesPKDTO.setModulecode( tgenechargesPK.getModulecode() );
        tgenechargesPKDTO.setStatuscode( tgenechargesPK.getStatuscode() );
        tgenechargesPKDTO.setCompanycode( (int) tgenechargesPK.getCompanycode() );
        tgenechargesPKDTO.setCurrencycode( tgenechargesPK.getCurrencycode() );
        tgenechargesPKDTO.setRatesequence( (int) tgenechargesPK.getRatesequence() );

        return tgenechargesPKDTO;
    }
}
