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

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

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

    @Override
    public Tgenesequences getEntidad(TgenesequencesDTO tgenesequences) {
        if ( tgenesequences == null ) {
            return null;
        }

        Tgenesequences tgenesequences1 = new Tgenesequences();

        tgenesequences1.setCode( tgenesequences.getCode() );
        if ( tgenesequences.getCurrentvalue() != null ) {
            tgenesequences1.setCurrentvalue( BigInteger.valueOf( tgenesequences.getCurrentvalue() ) );
        }
        if ( tgenesequences.getInitialvalue() != null ) {
            tgenesequences1.setInitialvalue( BigInteger.valueOf( tgenesequences.getInitialvalue() ) );
        }
        if ( tgenesequences.getLastvalue() != null ) {
            tgenesequences1.setLastvalue( BigInteger.valueOf( tgenesequences.getLastvalue() ) );
        }
        tgenesequences1.setCyclic( tgenesequences.getCyclic() );
        if ( tgenesequences.getIncrease() != null ) {
            tgenesequences1.setIncrease( tgenesequences.getIncrease() );
        }

        return tgenesequences1;
    }

    @Override
    public TgenesequencesDTO getDto(Tgenesequences tgenesequences) {
        if ( tgenesequences == null ) {
            return null;
        }

        TgenesequencesDTO tgenesequencesDTO = new TgenesequencesDTO();

        tgenesequencesDTO.setCode( tgenesequences.getCode() );
        if ( tgenesequences.getCurrentvalue() != null ) {
            tgenesequencesDTO.setCurrentvalue( tgenesequences.getCurrentvalue().intValue() );
        }
        if ( tgenesequences.getInitialvalue() != null ) {
            tgenesequencesDTO.setInitialvalue( tgenesequences.getInitialvalue().intValue() );
        }
        if ( tgenesequences.getLastvalue() != null ) {
            tgenesequencesDTO.setLastvalue( tgenesequences.getLastvalue().intValue() );
        }
        tgenesequencesDTO.setCyclic( tgenesequences.getCyclic() );
        tgenesequencesDTO.setIncrease( tgenesequences.getIncrease() );

        return tgenesequencesDTO;
    }
}
