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

import com.qsoft.rs.sincoar.dto.TsafeterminalPKDTO;
import com.qsoft.rs.sincoar.model.TsafeterminalPK;
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 TsafeterminalPKMapperImpl implements TsafeterminalPKMapper {

    @Override
    public TsafeterminalPK getEntidad(TsafeterminalPKDTO tsafeterminalPK) {
        if ( tsafeterminalPK == null ) {
            return null;
        }

        TsafeterminalPK tsafeterminalPK1 = new TsafeterminalPK();

        tsafeterminalPK1.setTerminalcode( tsafeterminalPK.getTerminalcode() );
        if ( tsafeterminalPK.getCompanycode() != null ) {
            tsafeterminalPK1.setCompanycode( tsafeterminalPK.getCompanycode() );
        }

        return tsafeterminalPK1;
    }

    @Override
    public TsafeterminalPKDTO getDto(TsafeterminalPK tsafeterminalPK) {
        if ( tsafeterminalPK == null ) {
            return null;
        }

        TsafeterminalPKDTO tsafeterminalPKDTO = new TsafeterminalPKDTO();

        tsafeterminalPKDTO.setTerminalcode( tsafeterminalPK.getTerminalcode() );
        tsafeterminalPKDTO.setCompanycode( (int) tsafeterminalPK.getCompanycode() );

        return tsafeterminalPKDTO;
    }
}
