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

import com.qsoft.rs.sincoar.dto.MdRegistryDTO;
import com.qsoft.rs.sincoar.model.MdRegistry;
import com.qsoft.rs.sincoar.model.MdRegistryPK;
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 MdRegistryMapperImpl implements MdRegistryMapper {

    @Override
    public MdRegistry getEntidad(MdRegistryDTO mdRegistry) {
        if ( mdRegistry == null ) {
            return null;
        }

        MdRegistry mdRegistry1 = new MdRegistry();

        mdRegistry1.setMdRegistryPK( mdRegistryDTOToMdRegistryPK( mdRegistry ) );
        mdRegistry1.setDescObjectName( mdRegistry.getDescObjectName() );

        return mdRegistry1;
    }

    @Override
    public MdRegistryDTO getDto(MdRegistry mdRegistry) {
        if ( mdRegistry == null ) {
            return null;
        }

        MdRegistryDTO mdRegistryDTO = new MdRegistryDTO();

        mdRegistryDTO.setMdRegistryPK( mdRegistryMdRegistryPKObjectName( mdRegistry ) );
        mdRegistryDTO.setObjectType( mdRegistryMdRegistryPKObjectType( mdRegistry ) );
        mdRegistryDTO.setDescObjectName( mdRegistry.getDescObjectName() );

        return mdRegistryDTO;
    }

    protected MdRegistryPK mdRegistryDTOToMdRegistryPK(MdRegistryDTO mdRegistryDTO) {
        if ( mdRegistryDTO == null ) {
            return null;
        }

        MdRegistryPK mdRegistryPK = new MdRegistryPK();

        mdRegistryPK.setObjectName( mdRegistryDTO.getMdRegistryPK() );
        mdRegistryPK.setObjectType( mdRegistryDTO.getObjectType() );

        return mdRegistryPK;
    }

    private String mdRegistryMdRegistryPKObjectName(MdRegistry mdRegistry) {
        if ( mdRegistry == null ) {
            return null;
        }
        MdRegistryPK mdRegistryPK = mdRegistry.getMdRegistryPK();
        if ( mdRegistryPK == null ) {
            return null;
        }
        String objectName = mdRegistryPK.getObjectName();
        if ( objectName == null ) {
            return null;
        }
        return objectName;
    }

    private String mdRegistryMdRegistryPKObjectType(MdRegistry mdRegistry) {
        if ( mdRegistry == null ) {
            return null;
        }
        MdRegistryPK mdRegistryPK = mdRegistry.getMdRegistryPK();
        if ( mdRegistryPK == null ) {
            return null;
        }
        String objectType = mdRegistryPK.getObjectType();
        if ( objectType == null ) {
            return null;
        }
        return objectType;
    }
}
