/* Generated from Java with JSweet 2.3.7 - http://www.jsweet.org */
import { NodeCompat } from '../../compat/NodeCompat';
import { RegexCompat } from '../../compat/RegexCompat';
/**
 * @author eric.wittmann@gmail.com
 * @class
 */
var ModelUtils = /** @class */ (function () {
    function ModelUtils() {
    }
    /**
     * Returns true if the given object is null or undefined.  Obviously Java does not have the concept
     * of "undefined" but this must also support the case where this code is running in Javascript.
     * @param {*} object
     * @return {boolean}
     */
    ModelUtils.isNullOrUndefined = function (object) {
        return NodeCompat.isNullOrUndefined(object);
    };
    /**
     * The opposite of isNullOrUndefined.
     * @param {*} object
     * @return {boolean}
     */
    ModelUtils.isDefined = function (object) {
        return !ModelUtils.isNullOrUndefined(object);
    };
    /**
     * Detects the appropriate path parameter names from a path.  For example, if the
     * string "/resources/{fooId}/subresources/{barId}" is passed in, the following
     * string array will be returned:  [ "fooId", "barId" ]
     * @param {string} path
     * @return {string[]}
     */
    ModelUtils.detectPathParamNames = function (path) {
        var paramNames = ([]);
        var matches = RegexCompat.findMatches(path, "\\{([^\\}]+)\\}");
        for (var index205 = 0; index205 < matches.length; index205++) {
            var match = matches[index205];
            {
                var name_1 = match[1];
                /* add */ (paramNames.push(name_1.trim()) > 0);
            }
        }
        return paramNames;
    };
    return ModelUtils;
}());
export { ModelUtils };
ModelUtils["__class"] = "io.apicurio.datamodels.cmd.util.ModelUtils";
//# sourceMappingURL=ModelUtils.js.map