Package tkrzw_rpc
Class Status
Object
Status
Status of operations
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContainer of a status and another arbitrary object.static enumEnumeration of status codes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Status.CodeStatus code: Generic error caused by the application logic.static final Status.CodeStatus code: Error that internal data are broken.static final Status.CodeStatus code: Error that the operation is canceled.static final Status.CodeStatus code: Error that a specific resource is duplicated.static final Status.CodeStatus code: Error that the operation is infeasible.static final Status.CodeStatus code: Error that a given argument is invalid.static final Status.CodeStatus code: Error caused by networking failure.static final Status.CodeStatus code: Error that a specific resource is not found.static final Status.CodeStatus code: Error that the feature is not implemented.static final Status.CodeStatus code: Error that the operation is not permitted.static final Status.CodeStatus code: Error that a precondition is not met.static final Status.CodeStatus code: Success.static final Status.CodeStatus code: Generic error from underlying systems.static final Status.CodeStatus code: Generic error whose cause is unknown. -
Constructor Summary
ConstructorsConstructorDescriptionStatus()Constructor representing the success code.Status(Status.Code code) Constructor representing a specific status code.Status(Status.Code code, String message) Constructor representing a specific status. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones the object.booleanChecks equality.booleanequals(Status.Code rhs) Checks equality.getCode()Gets the status code.Gets the status message.booleanisOK()Returns true if the status is success.voidAssigns the internal state from another status object only if the current state is success.voidorDie()Throws an exception if the status is not success.voidset(Status.Code code, String message) Sets the code and the message.toString()Gets the string expression.
-
Field Details
-
SUCCESS
Status code: Success. -
UNKNOWN_ERROR
Status code: Generic error whose cause is unknown. -
SYSTEM_ERROR
Status code: Generic error from underlying systems. -
NOT_IMPLEMENTED_ERROR
Status code: Error that the feature is not implemented. -
PRECONDITION_ERROR
Status code: Error that a precondition is not met. -
INVALID_ARGUMENT_ERROR
Status code: Error that a given argument is invalid. -
CANCELED_ERROR
Status code: Error that the operation is canceled. -
NOT_FOUND_ERROR
Status code: Error that a specific resource is not found. -
PERMISSION_ERROR
Status code: Error that the operation is not permitted. -
INFEASIBLE_ERROR
Status code: Error that the operation is infeasible. -
DUPLICATION_ERROR
Status code: Error that a specific resource is duplicated. -
BROKEN_DATA_ERROR
Status code: Error that internal data are broken. -
NETWORK_ERROR
Status code: Error caused by networking failure. -
APPLICATION_ERROR
Status code: Generic error caused by the application logic.
-
-
Constructor Details
-
Status
public Status()Constructor representing the success code. -
Status
Constructor representing a specific status code.- Parameters:
code- The status code.
-
Status
Constructor representing a specific status.- Parameters:
code- The status code.message- An arbitrary status message.
-
-
Method Details
-
getCode
Gets the status code.- Returns:
- The status code.
-
getMessage
Gets the status message.- Returns:
- The status message.
-
set
Sets the code and the message.- Parameters:
code- The status code.message- An arbitrary status message.
-
join
Assigns the internal state from another status object only if the current state is success.- Parameters:
rhs- The status object.
-
toString
Gets the string expression. -
equals
Checks equality.- Parameters:
rhs- a status object.- Returns:
- True for the both operands are equal, or false if not.
-
equals
Checks equality.- Parameters:
rhs- a status code.- Returns:
- True for the both operands are equal, or false if not.
-
clone
Clones the object. -
isOK
public boolean isOK()Returns true if the status is success.- Returns:
- True if the status is success, or false if not.
-
orDie
public void orDie()Throws an exception if the status is not success.- Throws:
StatusException- The exception object containing the status.
-