Package tkrzw
Class Status
Object
Status
Status of operations
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Container of a status and another arbitrary object.static enum
Enumeration of status codes. -
Field Summary
Modifier and TypeFieldDescriptionstatic final Status.Code
Status code: Generic error caused by the application logic.static final Status.Code
Status code: Error that internal data are broken.static final Status.Code
Status code: Error that the operation is canceled.static final Status.Code
Status code: Error that a specific resource is duplicated.static final Status.Code
Status code: Error that the operation is infeasible.static final Status.Code
Status code: Error that a given argument is invalid.static final Status.Code
Status code: Error caused by networking failure.static final Status.Code
Status code: Error that a specific resource is not found.static final Status.Code
Status code: Error that the feature is not implemented.static final Status.Code
Status code: Error that the operation is not permitted.static final Status.Code
Status code: Error that a precondition is not met.static final Status.Code
Status code: Success.static final Status.Code
Status code: Generic error from underlying systems.static final Status.Code
Status code: Generic error whose cause is unknown. -
Constructor Summary
ConstructorDescriptionStatus()
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.boolean
Checks equality.boolean
equals
(Status.Code rhs) Checks equality.getCode()
Gets the status code.Gets the status message.boolean
isOK()
Returns true if the status is success.void
Assigns the internal state from another status object only if the current state is success.void
orDie()
Throws an exception if the status is not success.void
set
(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.
-