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

import com.qsoft.rs.sincoar.dto.TsafeprofilehoraryPKDTO;
import com.qsoft.rs.sincoar.model.TsafeprofilehoraryPK;
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 TsafeprofilehoraryPKMapperImpl implements TsafeprofilehoraryPKMapper {

    @Override
    public TsafeprofilehoraryPK getEntidad(TsafeprofilehoraryPKDTO tsafeprofilehoraryPK) {
        if ( tsafeprofilehoraryPK == null ) {
            return null;
        }

        TsafeprofilehoraryPK tsafeprofilehoraryPK1 = new TsafeprofilehoraryPK();

        tsafeprofilehoraryPK1.setProfilecode( tsafeprofilehoraryPK.getProfilecode() );
        tsafeprofilehoraryPK1.setTransactionmodule( tsafeprofilehoraryPK.getTransactionmodule() );
        if ( tsafeprofilehoraryPK.getTransactioncode() != null ) {
            tsafeprofilehoraryPK1.setTransactioncode( tsafeprofilehoraryPK.getTransactioncode().shortValue() );
        }
        if ( tsafeprofilehoraryPK.getTransactionversion() != null ) {
            tsafeprofilehoraryPK1.setTransactionversion( tsafeprofilehoraryPK.getTransactionversion().shortValue() );
        }
        if ( tsafeprofilehoraryPK.getDay() != null ) {
            tsafeprofilehoraryPK1.setDay( tsafeprofilehoraryPK.getDay().shortValue() );
        }

        return tsafeprofilehoraryPK1;
    }

    @Override
    public TsafeprofilehoraryPKDTO getDto(TsafeprofilehoraryPK tsafeprofilehoraryPK) {
        if ( tsafeprofilehoraryPK == null ) {
            return null;
        }

        TsafeprofilehoraryPKDTO tsafeprofilehoraryPKDTO = new TsafeprofilehoraryPKDTO();

        tsafeprofilehoraryPKDTO.setProfilecode( tsafeprofilehoraryPK.getProfilecode() );
        tsafeprofilehoraryPKDTO.setTransactionmodule( tsafeprofilehoraryPK.getTransactionmodule() );
        tsafeprofilehoraryPKDTO.setTransactioncode( (int) tsafeprofilehoraryPK.getTransactioncode() );
        tsafeprofilehoraryPKDTO.setTransactionversion( (int) tsafeprofilehoraryPK.getTransactionversion() );
        tsafeprofilehoraryPKDTO.setDay( (int) tsafeprofilehoraryPK.getDay() );

        return tsafeprofilehoraryPKDTO;
    }
}
