public class Status extends Object implements Cloneable
String
. The integer
should be 0 for success, +ive for warning, and -ve for failure.Modifier and Type | Field and Description |
---|---|
static int |
BAD_CONTENT_FIELD |
static int |
BAD_REPLY_TO_FIELD |
private int |
code |
static int |
EXCEPTION_CAUGHT |
private String |
explanation
the explanation for the Status
|
static int |
SUCCESS |
static int |
TIMEOUT |
static int |
UNEXEPCTED_EXCEPTION_CAUGHT |
static int |
UNKNOWN_ERROR |
static int |
UNKNOWN_REPLY |
static int |
UNKNOWN_WARNING |
Constructor and Description |
---|
Status()
the default constructor
|
Status(int status)
a constructor that takes an integer representation of the current status
|
Status(int status,
String explanation)
a constructor that takes the integer representation of the current status with a String explanation
|
Status(int status,
String explanation,
Throwable ex) |
Status(Status s)
Copy constructor
|
Status(String s) |
Modifier and Type | Method and Description |
---|---|
protected Object |
clone() |
String |
codeToString()
a function to convert the variable representation of a status in code to a string
|
protected void |
fromString_extension(TokenParser parser)
To be overridden by subclasses to read any additional information from a string.
|
void |
fromString(TokenParser parser) |
static void |
fromString(TokenParser parser,
Status status) |
static Status |
fromString2(String in) |
String |
getExplanation() |
int |
getStatusValue() |
static void |
main(String[] args) |
void |
setExplanation(String explanation) |
Status |
setStatus(int status,
String explanation) |
void |
setStatusValue(int status) |
protected String |
toString_extension()
To be overridden by subclasses to write out any extended data.
|
String |
toString()
other methods
|
private int code
private String explanation
public static final int SUCCESS
public static final int UNKNOWN_WARNING
public static final int UNKNOWN_ERROR
public static final int UNEXEPCTED_EXCEPTION_CAUGHT
public static final int EXCEPTION_CAUGHT
public static final int TIMEOUT
public static final int UNKNOWN_REPLY
public static final int BAD_REPLY_TO_FIELD
public static final int BAD_CONTENT_FIELD
public Status()
public Status(int status)
status
- the status to set topublic Status(int status, String explanation)
status
- the status to set toexplanation
- the explanation for the statuspublic Status(Status s)
s
- the constructor to be copiedpublic String codeToString()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void setStatusValue(int status)
public int getStatusValue()
public void setExplanation(String explanation)
explanation
- public String getExplanation()
protected String toString_extension()
public static void fromString(TokenParser parser, Status status) throws Exception
Exception
public void fromString(TokenParser parser) throws Exception
Exception
protected void fromString_extension(TokenParser parser) throws Exception
parser
- status
- ParseException
Exception
public static void main(String[] args)