juglr.net
Enum HTTP.Status

java.lang.Object
  extended by java.lang.Enum<HTTP.Status>
      extended by juglr.net.HTTP.Status
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<HTTP.Status>
Enclosing class:
HTTP

public static enum HTTP.Status
extends java.lang.Enum<HTTP.Status>

HTTP Status Codes - see RFC 2616. This is an incomplete list but it covers the most used status codes.


Enum Constant Summary
Accepted
           
BadRequest
           
Conflict
           
Created
           
Forbidden
           
Found
           
InternalError
           
MethodNotAllowed
           
NoContent
           
NotAcceptable
           
NotFound
           
OK
           
RequestTimeout
           
Unauthorized
           
 
Method Summary
static HTTP.Status fromHttpOrdinal(int ord)
          Return a Status instance matching a given numrical HTTP status code.
 int httpOrdinal()
          Return the numrical HTTP status code for a Status instance.
static HTTP.Status valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static HTTP.Status[] 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

OK

public static final HTTP.Status OK

Created

public static final HTTP.Status Created

Accepted

public static final HTTP.Status Accepted

NoContent

public static final HTTP.Status NoContent

Found

public static final HTTP.Status Found

BadRequest

public static final HTTP.Status BadRequest

Unauthorized

public static final HTTP.Status Unauthorized

Forbidden

public static final HTTP.Status Forbidden

NotFound

public static final HTTP.Status NotFound

MethodNotAllowed

public static final HTTP.Status MethodNotAllowed

NotAcceptable

public static final HTTP.Status NotAcceptable

RequestTimeout

public static final HTTP.Status RequestTimeout

Conflict

public static final HTTP.Status Conflict

InternalError

public static final HTTP.Status InternalError
Method Detail

values

public static HTTP.Status[] 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 (HTTP.Status c : HTTP.Status.values())
    System.out.println(c);

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

valueOf

public static HTTP.Status valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

httpOrdinal

public int httpOrdinal()
Return the numrical HTTP status code for a Status instance. The code fromHttpOrdinal(status.httpOrdinal()) == status is guaranteed to evaluate to true.

Returns:
the numrical HTTP status code for the instance

fromHttpOrdinal

public static HTTP.Status fromHttpOrdinal(int ord)
Return a Status instance matching a given numrical HTTP status code. The code fromHttpOrdinal(status.httpOrdinal()) == status is guaranteed to evaluate to true.

Parameters:
ord - the numerical status code
Returns:
the Status instance matching ord