"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.TraitGroupPersistence = void 0;
const internal_1 = require("../../internal");
const copyDataUtils = require("../../Utilities/CopyDataUtils");
const utils = require("./utils");
class TraitGroupPersistence {
    static fromData(ctx, object) {
        const traitGroup = ctx.corpus.MakeObject(internal_1.cdmObjectType.traitGroupDef, object.traitGroupName);
        traitGroup.explanation = object.explanation;
        utils.addArrayToCdmCollection(traitGroup.exhibitsTraits, utils.createTraitReferenceArray(ctx, object.exhibitsTraits));
        return traitGroup;
    }
    static toData(instance, resOpt, options) {
        return {
            traitGroupName: instance.traitGroupName,
            explanation: instance.explanation,
            exhibitsTraits: copyDataUtils.arrayCopyData(resOpt, instance.exhibitsTraits, options)
        };
    }
}
exports.TraitGroupPersistence = TraitGroupPersistence;
//# sourceMappingURL=TraitGroupPersistence.js.map