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 { CombinedVisitorAdapter } from '../../combined/visitors/CombinedVisitorAdapter';
import { NodeCompat } from '../../compat/NodeCompat';
/**
 * Constructor.
 * @param {string} operationId
 * @class
 * @extends CombinedVisitorAdapter
 * @author eric.wittmann@gmail.com
 */
var OperationFinder = /** @class */ (function (_super) {
    __extends(OperationFinder, _super);
    function OperationFinder(operationId) {
        var _this = this;
        if (((typeof operationId === 'string') || operationId === null)) {
            var __args = arguments;
            _this = _super.call(this) || this;
            if (_this.operationId === undefined)
                _this.operationId = null;
            if (_this.found === undefined)
                _this.found = null;
            if (_this.operationId === undefined)
                _this.operationId = null;
            if (_this.found === undefined)
                _this.found = null;
            (function () {
                _this.operationId = operationId;
            })();
        }
        else if (operationId === undefined) {
            var __args = arguments;
            _this = _super.call(this) || this;
            if (_this.operationId === undefined)
                _this.operationId = null;
            if (_this.found === undefined)
                _this.found = null;
            if (_this.operationId === undefined)
                _this.operationId = null;
            if (_this.found === undefined)
                _this.found = null;
            (function () {
                _this.operationId = null;
            })();
        }
        else
            throw new Error('invalid overload');
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.visitors.VisitorAdapter#visitOperation(io.apicurio.datamodels.core.models.common.Operation)
     * @param {Operation} node
     */
    OperationFinder.prototype.visitOperation = function (node) {
        if (this.operationId == null || NodeCompat.equals(this.operationId, node.operationId)) {
            if (this.found == null) {
                this.found = node;
            }
        }
    };
    /**
     * Returns true if an operation was found.
     * @return {boolean}
     */
    OperationFinder.prototype.isFound = function () {
        return this.found != null;
    };
    return OperationFinder;
}(CombinedVisitorAdapter));
export { OperationFinder };
OperationFinder["__class"] = "io.apicurio.datamodels.core.visitors.OperationFinder";
OperationFinder["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor", "io.apicurio.datamodels.asyncapi.v2.visitors.IAai20Visitor", "io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor", "io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor", "io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor", "io.apicurio.datamodels.openapi.visitors.IOasVisitor"];
//# sourceMappingURL=OperationFinder.js.map