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';
/**
 * Constructor.
 * @param {string} name
 * @class
 * @extends ExtensibleNode
 * @author eric.wittmann@gmail.com
 */
var Oas30Encoding = /** @class */ (function (_super) {
    __extends(Oas30Encoding, _super);
    function Oas30Encoding(name) {
        var _this = _super.call(this) || this;
        if (_this._name === undefined)
            _this._name = null;
        if (_this.contentType === undefined)
            _this.contentType = null;
        _this.headers = ({});
        if (_this.style === undefined)
            _this.style = null;
        if (_this.explode === undefined)
            _this.explode = null;
        if (_this.allowReserved === undefined)
            _this.allowReserved = null;
        _this._name = name;
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#getName()
     * @return {string}
     */
    Oas30Encoding.prototype.getName = function () {
        return this._name;
    };
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#rename(java.lang.String)
     * @param {string} newName
     */
    Oas30Encoding.prototype.rename = function (newName) {
        this._name = newName;
    };
    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     * @param {*} visitor
     */
    Oas30Encoding.prototype.accept = function (visitor) {
        var viz = visitor;
        viz.visitEncoding(this);
    };
    /**
     * Creates a header.
     * @param {string} name
     * @return {Oas30Header}
     */
    Oas30Encoding.prototype.createHeader = function (name) {
        var rval = new Oas30Header(name);
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a header.
     * @param {string} name
     * @param {Oas30Header} header
     */
    Oas30Encoding.prototype.addHeader = function (name, header) {
        /* put */ (this.headers[name] = header);
    };
    /**
     * Gets a single header by name.
     * @param {string} name
     * @return {Oas30Header}
     */
    Oas30Encoding.prototype.getHeader = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.headers, name);
    };
    /**
     * Gets the header names.
     * @return {string[]}
     */
    Oas30Encoding.prototype.getHeaderNames = function () {
        var rval = ([]);
        /* addAll */ (function (l1, l2) { return l1.push.apply(l1, l2); })(rval, /* keySet */ Object.keys(this.headers));
        return rval;
    };
    /**
     * Removes a single header and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30Header}
     */
    Oas30Encoding.prototype.removeHeader = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.headers[name]; delete _this.headers[name]; return deleted; })(this.headers);
    };
    /**
     * Gets a list of all headers.
     * @return {Oas30Header[]}
     */
    Oas30Encoding.prototype.getHeaders = 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.headers));
        return rval;
    };
    return Oas30Encoding;
}(ExtensibleNode));
export { Oas30Encoding };
Oas30Encoding["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Encoding";
Oas30Encoding["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.common.INamed"];
import { Oas30Header } from './Oas30Header';
//# sourceMappingURL=Oas30Encoding.js.map