Packageorg.spicefactory.lib.command.base
Classpublic class DefaultCommandResult
InheritanceDefaultCommandResult Inheritance Object
Implements CommandResult

Default implementation of the CommandResult interface.



Public Properties
 PropertyDefined By
  command : Object
[read-only] The command that produced the result.
DefaultCommandResult
  complete : Boolean
[read-only] Whether the command completed successfully.
DefaultCommandResult
  value : Object
[read-only] The actual result value.
DefaultCommandResult
Public Methods
 MethodDefined By
  
[static] Creates a new instance for a command that has been cancelled.
DefaultCommandResult
  
forCompletion(command:Object, result:Object):CommandResult
[static] Creates a new instance for a command that successfully completed.
DefaultCommandResult
  
forError(command:Object, cause:Object):CommandResult
[static] Creates a new instance for a command that failed to execute.
DefaultCommandResult
Property Detail
commandproperty
command:Object  [read-only]

The command that produced the result.


Implementation
    public function get command():Object
completeproperty 
complete:Boolean  [read-only]

Whether the command completed successfully. If this flag is false, the value property represents the error thrown or dispatched by the command.


Implementation
    public function get complete():Boolean
valueproperty 
value:Object  [read-only]

The actual result value.


Implementation
    public function get value():Object
Method Detail
forCancellation()method
public static function forCancellation(command:Object):CommandResult

Creates a new instance for a command that has been cancelled.

Parameters

command:Object — the command that has been cancelled

Returns
CommandResult
forCompletion()method 
public static function forCompletion(command:Object, result:Object):CommandResult

Creates a new instance for a command that successfully completed.

Parameters

command:Object — the command that completed its execution
 
result:Object — the result produced by the command

Returns
CommandResult
forError()method 
public static function forError(command:Object, cause:Object):CommandResult

Creates a new instance for a command that failed to execute.

Parameters

command:Object — the command that failed to execute
 
cause:Object — the cause of the error

Returns
CommandResult