"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.CdmEntityReference = void 0;
const internal_1 = require("../internal");
class CdmEntityReference extends internal_1.CdmObjectReferenceBase {
    /**
     * Returns true if this entity reference points to a projection.
     * @internal
     */
    get isProjection() {
        var _a;
        return ((_a = this.explicitReference) === null || _a === void 0 ? void 0 : _a.objectType) == internal_1.cdmObjectType.projectionDef;
    }
    static get objectType() {
        return internal_1.cdmObjectType.entityRef;
    }
    constructor(ctx, entityRef, simpleReference) {
        super(ctx, entityRef, simpleReference);
        // let bodyCode = () =>
        {
            this.objectType = internal_1.cdmObjectType.entityRef;
        }
        // return p.measure(bodyCode);
    }
    getObjectType() {
        // let bodyCode = () =>
        {
            return internal_1.cdmObjectType.entityRef;
        }
        // return p.measure(bodyCode);
    }
    /**
     * @internal
     */
    copyRefObject(resOpt, refTo, simpleReference, host) {
        // let bodyCode = () =>
        {
            if (!host) {
                return new CdmEntityReference(this.ctx, refTo, simpleReference);
            }
            else {
                return host.copyToHost(this.ctx, refTo, simpleReference);
            }
        }
        // return p.measure(bodyCode);
    }
    /**
     * @internal
     */
    visitRef(pathFrom, preChildren, postChildren) {
        // let bodyCode = () =>
        {
            return false;
        }
        // return p.measure(bodyCode);
    }
}
exports.CdmEntityReference = CdmEntityReference;
//# sourceMappingURL=CdmEntityReference.js.map