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

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

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

    @Override
    public Tgenecredittype getEntidad(TgenecredittypeDTO tgenecredittype) {
        if ( tgenecredittype == null ) {
            return null;
        }

        Tgenecredittype tgenecredittype1 = new Tgenecredittype();

        tgenecredittype1.setCredittypecode( tgenecredittype.getCredittypecode() );
        if ( tgenecredittype.getRecordversion() != null ) {
            tgenecredittype1.setRecordversion( BigInteger.valueOf( tgenecredittype.getRecordversion() ) );
        }
        tgenecredittype1.setDescription( tgenecredittype.getDescription() );
        tgenecredittype1.setGracedays( tgenecredittype.getGracedays() );
        tgenecredittype1.setCreditgracedays( tgenecredittype.getCreditgracedays() );

        return tgenecredittype1;
    }

    @Override
    public TgenecredittypeDTO getDto(Tgenecredittype tgenecredittype) {
        if ( tgenecredittype == null ) {
            return null;
        }

        TgenecredittypeDTO tgenecredittypeDTO = new TgenecredittypeDTO();

        tgenecredittypeDTO.setCredittypecode( tgenecredittype.getCredittypecode() );
        if ( tgenecredittype.getRecordversion() != null ) {
            tgenecredittypeDTO.setRecordversion( tgenecredittype.getRecordversion().intValue() );
        }
        tgenecredittypeDTO.setDescription( tgenecredittype.getDescription() );
        tgenecredittypeDTO.setGracedays( tgenecredittype.getGracedays() );
        tgenecredittypeDTO.setCreditgracedays( tgenecredittype.getCreditgracedays() );

        return tgenecredittypeDTO;
    }
}
