ern-api-gen
Version:
Electrode Native API generator
94 lines • 2.44 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/* tslint:disable:variable-name */
const AbstractModel_1 = __importDefault(require("./AbstractModel"));
class ComposedModel extends AbstractModel_1.default {
constructor() {
super(...arguments);
this.allOf = [];
}
parent(model) {
this.setParent(model);
return this;
}
child(model) {
this.setChild(model);
return this;
}
interfaces(interfaces) {
this.setInterfaces(interfaces);
return this;
}
getDescription() {
return this.description;
}
setDescription(description) {
this.description = description;
}
getProperties() {
return null;
}
setProperties(properties) {
// Empty
}
getExample() {
return this.example;
}
setExample(example) {
this.example = example;
}
getAllOf() {
return this.allOf;
}
setAllOf(allOf) {
this.allOf = allOf;
}
getParent() {
return this.__parent;
}
setParent(model) {
this.__parent = model;
if (this.allOf.indexOf(model) === -1) {
this.allOf.push(model);
}
}
getChild() {
return this.__child;
}
setChild(model) {
this.__child = model;
if (this.allOf.indexOf(model) === -1) {
this.allOf.push(model);
}
}
getInterfaces() {
return this.__interfaces;
}
setInterfaces(interfaces) {
this.__interfaces = interfaces;
for (const model of interfaces) {
if (this.allOf.indexOf(model) === -1) {
this.allOf.push(model);
}
}
}
clone() {
const res = new ComposedModel();
res.allOf = this.allOf;
res.description = this.description;
res.example = this.example;
res.__parent = this.__parent;
res.__child = this.__child;
res.__interfaces = this.__interfaces;
res.vendorExtensions = this.vendorExtensions;
res.externalDocs = this.externalDocs;
res.title = this.title;
res.reference = this.reference;
return res;
}
}
exports.default = ComposedModel;
//# sourceMappingURL=ComposedModel.js.map