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 { NodeCompat } from '../../compat/NodeCompat';
import { Oas20VisitorAdapter } from '../../openapi/v2/visitors/Oas20VisitorAdapter';
/**
 * Finds the first path item.
 * @author eric.wittmann@gmail.com
 * @class
 * @extends Oas20VisitorAdapter
 */
var ConsumesProducesFinder = /** @class */ (function (_super) {
    __extends(ConsumesProducesFinder, _super);
    function ConsumesProducesFinder() {
        var _this = _super.call(this) || this;
        if (_this.consumes === undefined)
            _this.consumes = null;
        if (_this.produces === undefined)
            _this.produces = null;
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.visitors.VisitorAdapter#visitDocument(io.apicurio.datamodels.core.models.Document)
     * @param {Document} node
     */
    ConsumesProducesFinder.prototype.visitDocument = function (node) {
        var doc = node;
        if (NodeCompat.isNullOrUndefined(this.consumes)) {
            this.consumes = doc.consumes;
        }
        if (NodeCompat.isNullOrUndefined(this.produces)) {
            this.produces = doc.produces;
        }
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.VisitorAdapter#visitOperation(io.apicurio.datamodels.core.models.common.Operation)
     * @param {Operation} node
     */
    ConsumesProducesFinder.prototype.visitOperation = function (node) {
        this.consumes = node.consumes;
        this.produces = node.produces;
    };
    return ConsumesProducesFinder;
}(Oas20VisitorAdapter));
export { ConsumesProducesFinder };
ConsumesProducesFinder["__class"] = "io.apicurio.datamodels.core.visitors.ConsumesProducesFinder";
ConsumesProducesFinder["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor", "io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor", "io.apicurio.datamodels.openapi.visitors.IOasVisitor"];
//# sourceMappingURL=ConsumesProducesFinder.js.map