public final class ArchiveConfigurationCommandResult extends Object
Result of an ArchiveConfigurationCommand. When an archive
configuration command is executed, this result object is returned in order to
provide an indication of whether the operation was successful or failed. In
case of failure, an optional error message may be supplied.
Instances of this class must be created through the
success(ArchiveConfigurationCommand) and
failure(ArchiveConfigurationCommand, String) methods.
| Modifier and Type | Method and Description |
|---|---|
static ArchiveConfigurationCommandResult |
create(ArchiveConfigurationCommand command,
boolean success,
String errorMessage)
Creates a result representing the specified arguments.
|
boolean |
equals(Object obj) |
static ArchiveConfigurationCommandResult |
failure(ArchiveConfigurationCommand command,
String errorMessage)
Creates a result that represents a failed execution of the specified
command.
|
ArchiveConfigurationCommand |
getCommand()
Returns the command for which this object represents the result of the
execution.
|
String |
getErrorMessage()
Returns the optional error message associated with this result.
|
int |
hashCode() |
boolean |
isSuccess()
Tells whether the execution of the command was successful.
|
static ArchiveConfigurationCommandResult |
success(ArchiveConfigurationCommand command)
Creates a result that represents a successful execution of the specified
command.
|
String |
toString() |
public static ArchiveConfigurationCommandResult create(ArchiveConfigurationCommand command, boolean success, String errorMessage)
success(ArchiveConfigurationCommand) and
failure(ArchiveConfigurationCommand, String) methods.command - command that was executed.success - true if the execution was successful,
false if it failed.errorMessage - optional error message describing the cause of the failure.
Must be null if success is
true.IllegalArgumentException - if success is true and
errorMessage is not null.NullPointerException - if command is null.failure(ArchiveConfigurationCommand, String),
success(ArchiveConfigurationCommand)public static ArchiveConfigurationCommandResult success(ArchiveConfigurationCommand command)
command - command that was executed successfully.NullPointerException - if command is null.public static ArchiveConfigurationCommandResult failure(ArchiveConfigurationCommand command, String errorMessage)
null, the specified error message is
attached to the result.command - command whose execution failed.errorMessage - optional error message describing the cause of the failure or
null if no such message can be provided.NullPointerException - if command is null.public ArchiveConfigurationCommand getCommand()
null.public String getErrorMessage()
isSuccess() returns
true), the returned value is always null. If
the execution of the command failed, the return value might still be
null if no error message was provided.null if no such message is available.public boolean isSuccess()
true if the command was executed successfully and
false if the execution failed.Copyright © 2011–2017 aquenos GmbH. All rights reserved.