messif.utility
Class ErrorCode

java.lang.Object
  extended by messif.utility.ErrorCode
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BucketErrorCode, OperationErrorCode

public class ErrorCode
extends java.lang.Object
implements java.io.Serializable

Base class for all error codes. Error codes represent a return value that can be used to indicate various states of execution. Error codes are compared according to their text representation.

See Also:
Serialized Form

Field Summary
static ErrorCode NOT_SET
          The initial value of an error code that was not set yet.
static ErrorCode UNKNOWN_ERROR
          Not specific error appeared.
 
Constructor Summary
protected ErrorCode(java.lang.String text)
          Creates a new instance of ErrorCode.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 int hashCode()
           
 boolean isSet()
          Returns true if the error code is not set yet (i.e. has the value of NOT_SET).
 boolean isUnknownError()
          Returns true if the error code is an unknown error (i.e. has the value of UNKNOWN_ERROR).
 java.lang.String toString()
          Returns the textual representation of this error code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_SET

public static ErrorCode NOT_SET
The initial value of an error code that was not set yet.


UNKNOWN_ERROR

public static ErrorCode UNKNOWN_ERROR
Not specific error appeared. You may look at the source code which produced it to get some help.

Constructor Detail

ErrorCode

protected ErrorCode(java.lang.String text)
Creates a new instance of ErrorCode. Use this constructor to create static members in classes to define new error codes.

Parameters:
text - the text representation of the new error code
Method Detail

isSet

public final boolean isSet()
Returns true if the error code is not set yet (i.e. has the value of NOT_SET).

Returns:
true if the error code is not set yet

isUnknownError

public final boolean isUnknownError()
Returns true if the error code is an unknown error (i.e. has the value of UNKNOWN_ERROR).

Returns:
true if the error code is an unknown error

toString

public final java.lang.String toString()
Returns the textual representation of this error code.

Overrides:
toString in class java.lang.Object
Returns:
the textual representation of this error code

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public final boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object