var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/* Generated from Java with JSweet 2.3.7 - http://www.jsweet.org */
import { Node } from '../../../core/models/Node';
/**
 * Constructor.
 * @class
 * @extends Node
 * @author eric.wittmann@gmail.com
 */
var Oas20Example = /** @class */ (function (_super) {
    __extends(Oas20Example, _super);
    function Oas20Example() {
        var _this = _super.call(this) || this;
        _this.items = ({});
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     * @param {*} visitor
     */
    Oas20Example.prototype.accept = function (visitor) {
        var viz = visitor;
        viz.visitExample(this);
    };
    /**
     * Returns an array of all the example content types.
     * @return {string[]}
     */
    Oas20Example.prototype.getExampleContentTypes = function () {
        var rval = ([]);
        /* addAll */ (function (l1, l2) { return l1.push.apply(l1, l2); })(rval, /* keySet */ Object.keys(this.items));
        return rval;
    };
    /**
     * Gets a single example.
     * @param {string} contentType
     * @return {*}
     */
    Oas20Example.prototype.getExample = function (contentType) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.items, contentType);
    };
    /**
     * Adds an example.
     * @param {string} contentType
     * @param {*} example
     */
    Oas20Example.prototype.addExample = function (contentType, example) {
        /* put */ (this.items[contentType] = example);
    };
    /**
     * Removes a single example.
     * @param {string} contentType
     * @return {*}
     */
    Oas20Example.prototype.removeExample = function (contentType) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.items[contentType]; delete _this.items[contentType]; return deleted; })(this.items);
    };
    /**
     * Gets the examples.
     * @return {*[]}
     */
    Oas20Example.prototype.getExamples = function () {
        var rval = ([]);
        /* addAll */ (function (l1, l2) { return l1.push.apply(l1, l2); })(rval, /* values */ (function (obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); })(this.items));
        return rval;
    };
    return Oas20Example;
}(Node));
export { Oas20Example };
Oas20Example["__class"] = "io.apicurio.datamodels.openapi.v2.models.Oas20Example";
Oas20Example["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.common.IExample"];
//# sourceMappingURL=Oas20Example.js.map