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

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

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

    @Override
    public Tgenecountry getEntidad(TgenecountryDTO tgenecountry) {
        if ( tgenecountry == null ) {
            return null;
        }

        Tgenecountry tgenecountry1 = new Tgenecountry();

        tgenecountry1.setCountrycode( tgenecountry.getCountrycode() );
        if ( tgenecountry.getRecordversion() != null ) {
            tgenecountry1.setRecordversion( BigInteger.valueOf( tgenecountry.getRecordversion() ) );
        }
        tgenecountry1.setInitials( tgenecountry.getInitials() );
        tgenecountry1.setAreacode( tgenecountry.getAreacode() );
        tgenecountry1.setDescription( tgenecountry.getDescription() );
        tgenecountry1.setCitizenship( tgenecountry.getCitizenship() );

        return tgenecountry1;
    }

    @Override
    public TgenecountryDTO getDto(Tgenecountry tgenecountry) {
        if ( tgenecountry == null ) {
            return null;
        }

        TgenecountryDTO tgenecountryDTO = new TgenecountryDTO();

        tgenecountryDTO.setCountrycode( tgenecountry.getCountrycode() );
        if ( tgenecountry.getRecordversion() != null ) {
            tgenecountryDTO.setRecordversion( tgenecountry.getRecordversion().intValue() );
        }
        tgenecountryDTO.setInitials( tgenecountry.getInitials() );
        tgenecountryDTO.setAreacode( tgenecountry.getAreacode() );
        tgenecountryDTO.setDescription( tgenecountry.getDescription() );
        tgenecountryDTO.setCitizenship( tgenecountry.getCitizenship() );

        return tgenecountryDTO;
    }
}
