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 { ExtensibleNode } from '../../../core/models/ExtensibleNode';
/**
 * Models an OpenAPI 3.0.x Discriminator.
 * @author eric.wittmann@gmail.com
 * @class
 * @extends ExtensibleNode
 */
var Oas30Discriminator = /** @class */ (function (_super) {
    __extends(Oas30Discriminator, _super);
    function Oas30Discriminator() {
        var _this = _super.call(this) || this;
        if (_this.propertyName === undefined)
            _this.propertyName = null;
        if (_this.mapping === undefined)
            _this.mapping = null;
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     * @param {*} visitor
     */
    Oas30Discriminator.prototype.accept = function (visitor) {
        var viz = visitor;
        viz.visitDiscriminator(this);
    };
    /**
     * Gets a mapping value by its key.
     * @param {string} key
     * @return {string}
     */
    Oas30Discriminator.prototype.getMapping = function (key) {
        if (this.mapping == null) {
            return null;
        }
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.mapping, key);
    };
    /**
     * Adds a mapping.
     * @param {string} key
     * @param {string} value
     */
    Oas30Discriminator.prototype.addMapping = function (key, value) {
        if (this.mapping == null) {
            this.mapping = ({});
        }
        /* put */ (this.mapping[key] = value);
    };
    return Oas30Discriminator;
}(ExtensibleNode));
export { Oas30Discriminator };
Oas30Discriminator["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Discriminator";
Oas30Discriminator["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable"];
//# sourceMappingURL=Oas30Discriminator.js.map