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 { ModelUtils } from '../util/ModelUtils';
import { NodePath } from '../../core/models/NodePath';
import { ChangePropertyCommand } from './ChangePropertyCommand';
/**
 * A command used to modify the simple property of a node.  Should not be used
 * to modify complex (object) properties, only simple property types like
 * string, boolean, number, etc.  This differs from {@link ChangePropertyCommand}
 * in that it can be constructed from a {@link NodePath} rather than a {@link Node}
 * and therefore can be used in {@link AggregateCommand} use-cases where there is
 * a Create followed by a SetProperty.
 *
 * @author eric.wittmann@gmail.com
 * @extends ChangePropertyCommand
 * @class
 */
var SetPropertyCommand = /** @class */ (function (_super) {
    __extends(SetPropertyCommand, _super);
    function SetPropertyCommand(nodePath, property, newValue) {
        var _this = this;
        if (((nodePath != null && nodePath instanceof NodePath) || nodePath === null) && ((typeof property === 'string') || property === null) && ((newValue != null) || newValue === null)) {
            var __args = arguments;
            _this = _super.call(this) || this;
            (function () {
                if (ModelUtils.isDefined(nodePath)) {
                    _this._nodePath = nodePath;
                }
                _this._property = property;
                _this._newValue = newValue;
            })();
        }
        else if (nodePath === undefined && property === undefined && newValue === undefined) {
            var __args = arguments;
            _this = _super.call(this) || this;
        }
        else
            throw new Error('invalid overload');
        return _this;
    }
    return SetPropertyCommand;
}(ChangePropertyCommand));
export { SetPropertyCommand };
SetPropertyCommand["__class"] = "io.apicurio.datamodels.cmd.commands.SetPropertyCommand";
SetPropertyCommand["__interfaces"] = ["io.apicurio.datamodels.cmd.ICommand"];
//# sourceMappingURL=SetPropertyCommand.js.map