com.radekzitek.userver.http
Class HttpStatusCode

java.lang.Object
  extended bycom.radekzitek.userver.http.HttpStatusCode
All Implemented Interfaces:
HttpObject

public class HttpStatusCode
extends java.lang.Object
implements HttpObject

Author:
rzitek

Field Summary
private static org.apache.log4j.Logger LOG
          Log4j logger.
private  int statusCode
          Status code.
 
Constructor Summary
HttpStatusCode()
          Creates empty status code.
HttpStatusCode(java.lang.String codeString)
          Creates status code from given string.
 
Method Summary
 void clear()
          Clears the status code.
 int getStatusCode()
          Retrieves the status code.
 void parse(java.lang.String codeString)
          Parses given string into the object.
 void setStatusCode(int statusCode)
          Sets the status code.
 java.lang.String toString()
          Converts the status code to string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG
Log4j logger.


statusCode

private int statusCode
Status code.

Constructor Detail

HttpStatusCode

public HttpStatusCode()
Creates empty status code.


HttpStatusCode

public HttpStatusCode(java.lang.String codeString)
               throws HttpStatusCodeFormatException
Creates status code from given string.

Parameters:
codeString - the status code string
Throws:
HttpStatusCodeFormatException - Thrown if the given string can not be parsed into integer.
Method Detail

clear

public void clear()
Clears the status code.

Specified by:
clear in interface HttpObject

getStatusCode

public int getStatusCode()
Retrieves the status code.

Returns:
the status code

parse

public void parse(java.lang.String codeString)
           throws HttpStatusCodeFormatException
Description copied from interface: HttpObject
Parses given string into the object.

Specified by:
parse in interface HttpObject
Parameters:
codeString - input string
Throws:
HttpStatusCodeFormatException

setStatusCode

public void setStatusCode(int statusCode)
Sets the status code.

Parameters:
statusCode - the status code to set

toString

public java.lang.String toString()
Converts the status code to string.

Specified by:
toString in interface HttpObject