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

import com.qsoft.rs.sincoar.dto.TgenefrequencyDTO;
import com.qsoft.rs.sincoar.model.Tgenefrequency;
import java.math.BigInteger;
import javax.annotation.processing.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2022-09-02T16:14:48-0500",
    comments = "version: 1.5.2.Final, compiler: javac, environment: Java 17.0.4 (Private Build)"
)
public class TgenefrequencyMapperImpl implements TgenefrequencyMapper {

    @Override
    public Tgenefrequency getEntidad(TgenefrequencyDTO tgenefrequency) {
        if ( tgenefrequency == null ) {
            return null;
        }

        Tgenefrequency tgenefrequency1 = new Tgenefrequency();

        tgenefrequency1.setFrecqencycode( tgenefrequency.getFrecqencycode() );
        if ( tgenefrequency.getRecordversion() != null ) {
            tgenefrequency1.setRecordversion( BigInteger.valueOf( tgenefrequency.getRecordversion() ) );
        }
        if ( tgenefrequency.getDays() != null ) {
            tgenefrequency1.setDays( tgenefrequency.getDays().shortValue() );
        }
        tgenefrequency1.setDescription( tgenefrequency.getDescription() );

        return tgenefrequency1;
    }

    @Override
    public TgenefrequencyDTO getDto(Tgenefrequency tgenefrequency) {
        if ( tgenefrequency == null ) {
            return null;
        }

        TgenefrequencyDTO tgenefrequencyDTO = new TgenefrequencyDTO();

        tgenefrequencyDTO.setFrecqencycode( tgenefrequency.getFrecqencycode() );
        if ( tgenefrequency.getRecordversion() != null ) {
            tgenefrequencyDTO.setRecordversion( tgenefrequency.getRecordversion().intValue() );
        }
        tgenefrequencyDTO.setDays( (int) tgenefrequency.getDays() );
        tgenefrequencyDTO.setDescription( tgenefrequency.getDescription() );

        return tgenefrequencyDTO;
    }
}
