react-application-core
Version:
A react-based application core for the business applications.
74 lines • 1.99 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Command = void 0;
var util_1 = require("../../util");
var command_param_1 = require("./command.param");
/**
* @stable [08.11.20]
*/
var Command = /** @class */ (function () {
function Command() {
this.params = {};
this.uuid = util_1.UuidUtils.uuid();
}
/**
* @stable [21.05.2018]
* @returns {Command}
*/
Command.newCommand = function () {
return new Command();
};
/**
* @stable [08.11.2020]
* @param $uuid
*/
Command.prototype.setUuid = function ($uuid) {
this.uuid = $uuid;
return this;
};
/**
* @stable [21.05.2018]
* @param {string} command
* @returns {Command}
*/
Command.prototype.setCommand = function (command) {
this.command = command;
return this;
};
/**
* @stable [21.05.2018]
* @param {string} paramName
* @param {AnyT} paramValue
* @returns {Command}
*/
Command.prototype.addParam = function (paramName, paramValue) {
this.params[paramName] = new command_param_1.CommandParam(paramName, paramValue);
return this;
};
/**
* @stable [21.05.2018]
* @returns {string}
*/
Command.prototype.getCommand = function () {
return this.command;
};
/**
* @stable [21.05.2018]
* @returns {string}
*/
Command.prototype.getUuid = function () {
return this.uuid;
};
/**
* @stable [21.05.2018]
* @returns {CommandParam[]}
*/
Command.prototype.getParams = function () {
var _this = this;
return Object.keys(this.params).map(function (key) { return _this.params[key]; });
};
Command.$PROTOCOL_PAYLOAD_CLASS_IDENTIFIER = 'Command';
return Command;
}());
exports.Command = Command;
//# sourceMappingURL=command.js.map