ern-api-gen
Version:
Electrode Native API generator
85 lines • 2.31 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const AbstractModel_1 = __importDefault(require("./AbstractModel"));
const RefType_1 = require("./refs/RefType");
const GenericRef_1 = __importDefault(require("./refs/GenericRef"));
class RefModel extends AbstractModel_1.default {
constructor(ref) {
super();
if (typeof ref === 'string') {
this.set$ref(ref);
}
}
asDefault(ref) {
this.setReference(RefType_1.DEFINITION.getInternalPrefix() + ref);
return this;
}
getTitle() {
return this.title;
}
setTitle(title) {
this.title = title;
}
getDescription() {
return this.description;
}
setDescription(description) {
this.description = description;
}
getProperties() {
return this.properties;
}
setProperties(properties) {
this.properties = properties;
}
getSimpleRef() {
return this.genericRef.getSimpleRef();
}
get$ref() {
return this.genericRef.getRef();
}
set$ref(ref) {
this.genericRef = new GenericRef_1.default(RefType_1.DEFINITION, ref);
}
getRefFormat() {
return this.genericRef.getFormat();
}
getExample() {
return this.example;
}
setExample(example) {
this.example = example;
}
getExternalDocs() {
return this.externalDocs;
}
setExternalDocs(value) {
this.externalDocs = value;
}
clone() {
const res = new RefModel();
res.description = this.description;
res.properties = this.properties;
res.genericRef = this.genericRef;
res.example = this.example;
res.vendorExtensions = this.vendorExtensions;
res.externalDocs = this.externalDocs;
res.title = this.title;
res.reference = this.reference;
return res;
}
getVendorExtensions() {
return null;
}
getReference() {
return this.genericRef.getRef();
}
setReference(reference) {
this.set$ref(reference);
}
}
exports.default = RefModel;
//# sourceMappingURL=RefModel.js.map