Constructor
new CommandResult(status, valueopt)
Constructor.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
status |
status of the command execution | |||
value |
<optional> |
null | result of the command execution |
- Source:
Classes
Members
status :number
Get the
status
property of this command result:
the status of the command execution.
Type:
- number
- Source:
- See:
value :string
Get the
value
property of this command result:
the result of the command execution.
May be null
, which means: nothing useful.
How to interpret value
depends on status
:
COMMAND_RESULT_DONE
- The result value, a string, or
null
. COMMAND_RESULT_STOPPED
(Remote command only.)null
or a string which normally, after parsing it, should be displayed in a dialog box (e.g. a list of choices letting the user specify what she/he wants).COMMAND_RESULT_CANCELED
- Should be
null
. COMMAND_RESULT_FAILED
- An error message or
null
.
Type:
- string
- Source:
Methods
(static) failed()
Convenience method equivalent to returning
new CommandResult(COMMAND_RESULT_FAILED,value)
.
- Source:
(static) isDone(result)
Convenience method: tests whether specified result is successful.
Parameters:
Name | Type | Description |
---|---|---|
result |
CommandResult | result to be tested;
may be null which is considered to be
a non-successful result. |
- Source:
toString()
Returns a a string representing this result.
- Source: