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

import com.qsoft.rs.sincoar.dto.TgenemessageDTO;
import com.qsoft.rs.sincoar.model.Tgenemessage;
import java.math.BigInteger;
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 TgenemessageMapperImpl implements TgenemessageMapper {

    @Override
    public Tgenemessage getEntidad(TgenemessageDTO tgenemessage) {
        if ( tgenemessage == null ) {
            return null;
        }

        Tgenemessage tgenemessage1 = new Tgenemessage();

        tgenemessage1.setMessagecode( tgenemessage.getMessagecode() );
        if ( tgenemessage.getRecordversion() != null ) {
            tgenemessage1.setRecordversion( BigInteger.valueOf( tgenemessage.getRecordversion() ) );
        }
        tgenemessage1.setDescription( tgenemessage.getDescription() );

        return tgenemessage1;
    }

    @Override
    public TgenemessageDTO getDto(Tgenemessage tgenemessage) {
        if ( tgenemessage == null ) {
            return null;
        }

        TgenemessageDTO tgenemessageDTO = new TgenemessageDTO();

        tgenemessageDTO.setMessagecode( tgenemessage.getMessagecode() );
        if ( tgenemessage.getRecordversion() != null ) {
            tgenemessageDTO.setRecordversion( tgenemessage.getRecordversion().intValue() );
        }
        tgenemessageDTO.setDescription( tgenemessage.getDescription() );

        return tgenemessageDTO;
    }
}
