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

import com.qsoft.rs.sincoar.dto.TgenedenominationPKDTO;
import com.qsoft.rs.sincoar.model.TgenedenominationPK;
import java.math.BigDecimal;
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 TgenedenominationPKMapperImpl implements TgenedenominationPKMapper {

    @Override
    public TgenedenominationPK getEntidad(TgenedenominationPKDTO tgenedenominationPK) {
        if ( tgenedenominationPK == null ) {
            return null;
        }

        TgenedenominationPK tgenedenominationPK1 = new TgenedenominationPK();

        tgenedenominationPK1.setCurrencycode( tgenedenominationPK.getCurrencycode() );
        tgenedenominationPK1.setCatalog( tgenedenominationPK.getCatalog() );
        tgenedenominationPK1.setCatalogcode( tgenedenominationPK.getCatalogcode() );
        if ( tgenedenominationPK.getValue() != null ) {
            tgenedenominationPK1.setValue( BigDecimal.valueOf( tgenedenominationPK.getValue() ) );
        }

        return tgenedenominationPK1;
    }

    @Override
    public TgenedenominationPKDTO getDto(TgenedenominationPK tgenedenominationPK) {
        if ( tgenedenominationPK == null ) {
            return null;
        }

        TgenedenominationPKDTO tgenedenominationPKDTO = new TgenedenominationPKDTO();

        tgenedenominationPKDTO.setCurrencycode( tgenedenominationPK.getCurrencycode() );
        tgenedenominationPKDTO.setCatalog( tgenedenominationPK.getCatalog() );
        tgenedenominationPKDTO.setCatalogcode( tgenedenominationPK.getCatalogcode() );
        if ( tgenedenominationPK.getValue() != null ) {
            tgenedenominationPKDTO.setValue( tgenedenominationPK.getValue().intValue() );
        }

        return tgenedenominationPKDTO;
    }
}
