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

import com.qsoft.rs.sincoar.dto.TgenebatchPKDTO;
import com.qsoft.rs.sincoar.model.TgenebatchPK;
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 TgenebatchPKMapperImpl implements TgenebatchPKMapper {

    @Override
    public TgenebatchPK getEntidad(TgenebatchPKDTO tgenebatchPK) {
        if ( tgenebatchPK == null ) {
            return null;
        }

        TgenebatchPK tgenebatchPK1 = new TgenebatchPK();

        tgenebatchPK1.setModulecode( tgenebatchPK.getModulecode() );
        tgenebatchPK1.setTransactionmodule( tgenebatchPK.getTransactionmodule() );
        if ( tgenebatchPK.getTransactioncode() != null ) {
            tgenebatchPK1.setTransactioncode( tgenebatchPK.getTransactioncode().shortValue() );
        }
        if ( tgenebatchPK.getTransactionversion() != null ) {
            tgenebatchPK1.setTransactionversion( tgenebatchPK.getTransactionversion().shortValue() );
        }

        return tgenebatchPK1;
    }

    @Override
    public TgenebatchPKDTO getDto(TgenebatchPK tgenebatchPK) {
        if ( tgenebatchPK == null ) {
            return null;
        }

        TgenebatchPKDTO tgenebatchPKDTO = new TgenebatchPKDTO();

        tgenebatchPKDTO.setModulecode( tgenebatchPK.getModulecode() );
        tgenebatchPKDTO.setTransactionmodule( tgenebatchPK.getTransactionmodule() );
        tgenebatchPKDTO.setTransactioncode( (int) tgenebatchPK.getTransactioncode() );
        tgenebatchPKDTO.setTransactionversion( (int) tgenebatchPK.getTransactionversion() );

        return tgenebatchPKDTO;
    }
}
