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

import com.qsoft.rs.sincoar.dto.TgeneareaPKDTO;
import com.qsoft.rs.sincoar.model.TgeneareaPK;
import javax.annotation.processing.Generated;

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

    @Override
    public TgeneareaPK getEntidad(TgeneareaPKDTO tgeneareaPK) {
        if ( tgeneareaPK == null ) {
            return null;
        }

        TgeneareaPK tgeneareaPK1 = new TgeneareaPK();

        if ( tgeneareaPK.getCompanycode() != null ) {
            tgeneareaPK1.setCompanycode( tgeneareaPK.getCompanycode() );
        }
        if ( tgeneareaPK.getAreacode() != null ) {
            tgeneareaPK1.setAreacode( tgeneareaPK.getAreacode().shortValue() );
        }

        return tgeneareaPK1;
    }

    @Override
    public TgeneareaPKDTO getDto(TgeneareaPK tgeneareaPK) {
        if ( tgeneareaPK == null ) {
            return null;
        }

        TgeneareaPKDTO tgeneareaPKDTO = new TgeneareaPKDTO();

        tgeneareaPKDTO.setCompanycode( (int) tgeneareaPK.getCompanycode() );
        tgeneareaPKDTO.setAreacode( (int) tgeneareaPK.getAreacode() );

        return tgeneareaPKDTO;
    }
}
