org.springframework.http
Enum HttpStatus

java.lang.Object
  extended by java.lang.Enum<HttpStatus>
      extended by org.springframework.http.HttpStatus
All Implemented Interfaces:
Serializable, Comparable<HttpStatus>

public enum HttpStatus
extends Enum<HttpStatus>

Java 5 enumeration of HTTP status codes.

The HTTP status code series can be retrieved via series().

Author:
Arjen Poutsma
See Also:
HttpStatus.Series

Nested Class Summary
static class HttpStatus.Series
          Java 5 enumeration of HTTP status series.
 
Enum Constant Summary
ACCEPTED
           
BAD_GATEWAY
           
BAD_REQUEST
           
CONFLICT
           
CONTINUE
           
CREATED
           
EXPECTATION_FAILED
           
FORBIDDEN
           
GATEWAY_TIMEOUT
           
GONE
           
HTTP_VERSION_NOT_SUPPORTED
           
INTERNAL_SERVER_ERROR
           
LENGTH_REQUIRED
           
METHOD_NOT_ALLOWED
           
MOVED_PERMANENTLY
           
MOVED_TEMPORARILY
           
MULTIPLE_CHOICES
           
NO_CONTENT
           
NON_AUTHORITATIVE_INFORMATION
           
NOT_ACCEPTABLE
           
NOT_FOUND
           
NOT_IMPLEMENTED
           
NOT_MODIFIED
           
OK
           
PARTIAL_CONTENT
           
PAYMENT_REQUIRED
           
PRECONDITION_FAILED
           
PROXY_AUTHENTICATION_REQUIRED
           
REQUEST_TIMEOUT
           
REQUEST_TOO_LONG
           
REQUEST_URI_TOO_LONG
           
REQUESTED_RANGE_NOT_SATISFIABLE
           
RESET_CONTENT
           
SEE_OTHER
           
SERVICE_UNAVAILABLE
           
SWITCHING_PROTOCOLS
           
TEMPORARY_REDIRECT
           
UNAUTHORIZED
           
UNSUPPORTED_MEDIA_TYPE
           
USE_PROXY
           
 
Method Summary
 HttpStatus.Series series()
          Returns the HTTP status series of this status code.
 String toString()
          Return a string representation of this status code.
 int value()
          Return the integer value of this status code.
static HttpStatus valueOf(int statusCode)
          Return the enum constant of this type with the specified numeric value.
static HttpStatus valueOf(String name)
          Returns the enum constant of this type with the specified name.
static HttpStatus[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CONTINUE

public static final HttpStatus CONTINUE

SWITCHING_PROTOCOLS

public static final HttpStatus SWITCHING_PROTOCOLS

OK

public static final HttpStatus OK

CREATED

public static final HttpStatus CREATED

ACCEPTED

public static final HttpStatus ACCEPTED

NON_AUTHORITATIVE_INFORMATION

public static final HttpStatus NON_AUTHORITATIVE_INFORMATION

NO_CONTENT

public static final HttpStatus NO_CONTENT

RESET_CONTENT

public static final HttpStatus RESET_CONTENT

PARTIAL_CONTENT

public static final HttpStatus PARTIAL_CONTENT

MULTIPLE_CHOICES

public static final HttpStatus MULTIPLE_CHOICES

MOVED_PERMANENTLY

public static final HttpStatus MOVED_PERMANENTLY

MOVED_TEMPORARILY

public static final HttpStatus MOVED_TEMPORARILY

SEE_OTHER

public static final HttpStatus SEE_OTHER

NOT_MODIFIED

public static final HttpStatus NOT_MODIFIED

USE_PROXY

public static final HttpStatus USE_PROXY

TEMPORARY_REDIRECT

public static final HttpStatus TEMPORARY_REDIRECT

BAD_REQUEST

public static final HttpStatus BAD_REQUEST

UNAUTHORIZED

public static final HttpStatus UNAUTHORIZED

PAYMENT_REQUIRED

public static final HttpStatus PAYMENT_REQUIRED

FORBIDDEN

public static final HttpStatus FORBIDDEN

NOT_FOUND

public static final HttpStatus NOT_FOUND

METHOD_NOT_ALLOWED

public static final HttpStatus METHOD_NOT_ALLOWED

NOT_ACCEPTABLE

public static final HttpStatus NOT_ACCEPTABLE

PROXY_AUTHENTICATION_REQUIRED

public static final HttpStatus PROXY_AUTHENTICATION_REQUIRED

REQUEST_TIMEOUT

public static final HttpStatus REQUEST_TIMEOUT

CONFLICT

public static final HttpStatus CONFLICT

GONE

public static final HttpStatus GONE

LENGTH_REQUIRED

public static final HttpStatus LENGTH_REQUIRED

PRECONDITION_FAILED

public static final HttpStatus PRECONDITION_FAILED

REQUEST_TOO_LONG

public static final HttpStatus REQUEST_TOO_LONG

REQUEST_URI_TOO_LONG

public static final HttpStatus REQUEST_URI_TOO_LONG

UNSUPPORTED_MEDIA_TYPE

public static final HttpStatus UNSUPPORTED_MEDIA_TYPE

REQUESTED_RANGE_NOT_SATISFIABLE

public static final HttpStatus REQUESTED_RANGE_NOT_SATISFIABLE

EXPECTATION_FAILED

public static final HttpStatus EXPECTATION_FAILED

INTERNAL_SERVER_ERROR

public static final HttpStatus INTERNAL_SERVER_ERROR

NOT_IMPLEMENTED

public static final HttpStatus NOT_IMPLEMENTED

BAD_GATEWAY

public static final HttpStatus BAD_GATEWAY

SERVICE_UNAVAILABLE

public static final HttpStatus SERVICE_UNAVAILABLE

GATEWAY_TIMEOUT

public static final HttpStatus GATEWAY_TIMEOUT

HTTP_VERSION_NOT_SUPPORTED

public static final HttpStatus HTTP_VERSION_NOT_SUPPORTED
Method Detail

values

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

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

valueOf

public static HttpStatus 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

value

public int value()
Return the integer value of this status code.


series

public HttpStatus.Series series()
Returns the HTTP status series of this status code.

See Also:
HttpStatus.Series

toString

public String toString()
Return a string representation of this status code.

Overrides:
toString in class Enum<HttpStatus>

valueOf

public static HttpStatus valueOf(int statusCode)
Return the enum constant of this type with the specified numeric value.

Parameters:
statusCode - the numeric value of the enum to be returned
Returns:
the enum constant with the specified numeric value
Throws:
IllegalArgumentException - if this enum has no constant for the specified numeric value