rabbit.http
Enum StatusCode

java.lang.Object
  extended by java.lang.Enum<StatusCode>
      extended by rabbit.http.StatusCode
All Implemented Interfaces:
Serializable, Comparable<StatusCode>

public enum StatusCode
extends Enum<StatusCode>

The http response codes.

Author:
Robert Olofsson

Enum Constant Summary
_100
          100 Continue
_101
          101 Switching Protocols
_200
          200 Ok
_201
          201 Created
_202
          202 Accepted
_203
          203 Non-Authoritative Information
_204
          204 No Content
_205
          205 Reset Content
_206
          206 Partial Content
_300
          300 Multiple Choices
_301
          301 Moved Permanently
_302
          302 Found
_303
          303 See Other
_304
          304 Not Modified
_305
          305 Use Proxy
_306
          306 (Unused)
_307
          307 Temporary Redirect
_400
          400 Bad Request
_401
          401 Unauthorized
_402
          402 Payment Required
_403
          403 Forbidden
_404
          404 Not Found
_405
          405 Method Not Allowed
_406
          406 Not Acceptable
_407
          407 Proxy Authentication Required
_408
          408 Request Timeout
_409
          409 Conflict
_410
          410 Gone
_411
          411 Length Required
_412
          412 Precondition Failed
_413
          413 Request Entity Too Large
_414
          414 Request-URI Too Long
_415
          415 Unsupported Media Type
_416
          416 Requested Range Not Satisfiable
_417
          417 Expectation Failed
_500
          500 Internal Server Error
_501
          501 Not Implemented
_502
          502 Bad Gateway
_503
          503 Service Unavailable
_504
          504 Gateway Timeout
_505
          505 HTTP Version Not Supported
 
Method Summary
 int getCode()
          Get the numeric value of the status code
 String getDescription()
          Get the human readable description of this status code.
 String getStatusLine(String httpVersion)
          Get a http response line using this status code
static StatusCode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StatusCode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

_100

public static final StatusCode _100
100 Continue


_101

public static final StatusCode _101
101 Switching Protocols


_200

public static final StatusCode _200
200 Ok


_201

public static final StatusCode _201
201 Created


_202

public static final StatusCode _202
202 Accepted


_203

public static final StatusCode _203
203 Non-Authoritative Information


_204

public static final StatusCode _204
204 No Content


_205

public static final StatusCode _205
205 Reset Content


_206

public static final StatusCode _206
206 Partial Content


_300

public static final StatusCode _300
300 Multiple Choices


_301

public static final StatusCode _301
301 Moved Permanently


_302

public static final StatusCode _302
302 Found


_303

public static final StatusCode _303
303 See Other


_304

public static final StatusCode _304
304 Not Modified


_305

public static final StatusCode _305
305 Use Proxy


_306

public static final StatusCode _306
306 (Unused)


_307

public static final StatusCode _307
307 Temporary Redirect


_400

public static final StatusCode _400
400 Bad Request


_401

public static final StatusCode _401
401 Unauthorized


_402

public static final StatusCode _402
402 Payment Required


_403

public static final StatusCode _403
403 Forbidden


_404

public static final StatusCode _404
404 Not Found


_405

public static final StatusCode _405
405 Method Not Allowed


_406

public static final StatusCode _406
406 Not Acceptable


_407

public static final StatusCode _407
407 Proxy Authentication Required


_408

public static final StatusCode _408
408 Request Timeout


_409

public static final StatusCode _409
409 Conflict


_410

public static final StatusCode _410
410 Gone


_411

public static final StatusCode _411
411 Length Required


_412

public static final StatusCode _412
412 Precondition Failed


_413

public static final StatusCode _413
413 Request Entity Too Large


_414

public static final StatusCode _414
414 Request-URI Too Long


_415

public static final StatusCode _415
415 Unsupported Media Type


_416

public static final StatusCode _416
416 Requested Range Not Satisfiable


_417

public static final StatusCode _417
417 Expectation Failed


_500

public static final StatusCode _500
500 Internal Server Error


_501

public static final StatusCode _501
501 Not Implemented


_502

public static final StatusCode _502
502 Bad Gateway


_503

public static final StatusCode _503
503 Service Unavailable


_504

public static final StatusCode _504
504 Gateway Timeout


_505

public static final StatusCode _505
505 HTTP Version Not Supported

Method Detail

values

public static StatusCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (StatusCode c : StatusCode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static StatusCode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getCode

public int getCode()
Get the numeric value of the status code

Returns:
the status code

getDescription

public String getDescription()
Get the human readable description of this status code.

Returns:
the description

getStatusLine

public String getStatusLine(String httpVersion)
Get a http response line using this status code

Parameters:
httpVersion - the HTTP version to use
Returns:
the formatted status line