Enum HttpStatusCode

java.lang.Object
java.lang.Enum<HttpStatusCode>
com.dlsc.gemsfx.util.HttpStatusCode
All Implemented Interfaces:
Serializable, Comparable<HttpStatusCode>

public enum HttpStatusCode extends Enum<HttpStatusCode>
Enum of standard HTTP status codes as defined by IANA HTTP Status Code Registry.

Each constant carries its numeric code, a human-readable reason phrase, and a HttpStatusCode.Family classification (1xx informational, 2xx success, 3xx redirection, 4xx client error, 5xx server error).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The available HTTP status code families.
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    202 Accepted — the request was accepted for processing but is not complete.
    502 Bad Gateway — a gateway or proxy received an invalid upstream response.
    400 Bad Request — the server cannot process the malformed request.
    409 Conflict — the request conflicts with the current resource state.
    201 Created — the request succeeded and created a new resource.
    417 Expectation Failed — the server cannot meet the Expect request-header expectation.
    403 Forbidden — the server understood the request but refuses to authorize it.
    302 Found — the resource is temporarily available under a different URI.
    504 Gateway Timeout — a gateway or proxy did not receive a timely upstream response.
    410 Gone — the resource is no longer available and no forwarding address is known.
    505 HTTP Version Not Supported — the server does not support the request HTTP version.
    500 Internal Server Error — the server encountered an unexpected condition.
    411 Length Required — the request requires a valid Content-Length header.
    405 Method Not Allowed — the request method is not supported for the resource.
    301 Moved Permanently — the resource has been assigned a new permanent URI.
    511 Network Authentication Required — the client must authenticate to gain network access.
    204 No Content — the request succeeded and there is no response body.
    406 Not Acceptable — no response representation matches the request headers.
    404 Not Found — the requested resource could not be found.
    501 Not Implemented — the server does not support the required functionality.
    304 Not Modified — the cached representation can be reused.
    200 OK — the request succeeded.
    206 Partial Content — the response contains the requested byte range.
    402 Payment Required — the status code is reserved for future use.
    412 Precondition Failed — a request precondition evaluated to false.
    428 Precondition Required — the origin server requires the request to be conditional.
    407 Proxy Authentication Required — authentication with a proxy is required.
    413 Request Entity Too Large — the request payload is larger than the server will process.
    431 Request Header Fields Too Large — the request header fields are too large.
    408 Request Timeout — the server timed out waiting for the request.
    414 Request-URI Too Long — the request URI is longer than the server will process.
    416 Requested Range Not Satisfiable — the requested range cannot be served.
    205 Reset Content — the request succeeded and the client should reset the document view.
    303 See Other — the response to the request can be found under another URI.
    503 Service Unavailable — the server is temporarily unable to handle the request.
    307 Temporary Redirect — the request should be repeated at another URI using the same method.
    429 Too Many Requests — the user has sent too many requests in a given time.
    401 Unauthorized — authentication is required or has failed.
    415 Unsupported Media Type — the request payload format is not supported.
    305 Use Proxy — the resource must be accessed through a proxy.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromStatusCode(int statusCode)
    Returns the enum constant for the given status code.
    Returns the status code family.
    Returns the reason phrase.
    int
    Returns the numeric status code.
    Returns the reason phrase.
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • OK

      public static final HttpStatusCode OK
      200 OK — the request succeeded.
    • CREATED

      public static final HttpStatusCode CREATED
      201 Created — the request succeeded and created a new resource.
    • ACCEPTED

      public static final HttpStatusCode ACCEPTED
      202 Accepted — the request was accepted for processing but is not complete.
    • NO_CONTENT

      public static final HttpStatusCode NO_CONTENT
      204 No Content — the request succeeded and there is no response body.
    • RESET_CONTENT

      public static final HttpStatusCode RESET_CONTENT
      205 Reset Content — the request succeeded and the client should reset the document view.
    • PARTIAL_CONTENT

      public static final HttpStatusCode PARTIAL_CONTENT
      206 Partial Content — the response contains the requested byte range.
    • MOVED_PERMANENTLY

      public static final HttpStatusCode MOVED_PERMANENTLY
      301 Moved Permanently — the resource has been assigned a new permanent URI.
    • FOUND

      public static final HttpStatusCode FOUND
      302 Found — the resource is temporarily available under a different URI.
    • SEE_OTHER

      public static final HttpStatusCode SEE_OTHER
      303 See Other — the response to the request can be found under another URI.
    • NOT_MODIFIED

      public static final HttpStatusCode NOT_MODIFIED
      304 Not Modified — the cached representation can be reused.
    • USE_PROXY

      public static final HttpStatusCode USE_PROXY
      305 Use Proxy — the resource must be accessed through a proxy.
    • TEMPORARY_REDIRECT

      public static final HttpStatusCode TEMPORARY_REDIRECT
      307 Temporary Redirect — the request should be repeated at another URI using the same method.
    • BAD_REQUEST

      public static final HttpStatusCode BAD_REQUEST
      400 Bad Request — the server cannot process the malformed request.
    • UNAUTHORIZED

      public static final HttpStatusCode UNAUTHORIZED
      401 Unauthorized — authentication is required or has failed.
    • PAYMENT_REQUIRED

      public static final HttpStatusCode PAYMENT_REQUIRED
      402 Payment Required — the status code is reserved for future use.
    • FORBIDDEN

      public static final HttpStatusCode FORBIDDEN
      403 Forbidden — the server understood the request but refuses to authorize it.
    • NOT_FOUND

      public static final HttpStatusCode NOT_FOUND
      404 Not Found — the requested resource could not be found.
    • METHOD_NOT_ALLOWED

      public static final HttpStatusCode METHOD_NOT_ALLOWED
      405 Method Not Allowed — the request method is not supported for the resource.
    • NOT_ACCEPTABLE

      public static final HttpStatusCode NOT_ACCEPTABLE
      406 Not Acceptable — no response representation matches the request headers.
    • PROXY_AUTHENTICATION_REQUIRED

      public static final HttpStatusCode PROXY_AUTHENTICATION_REQUIRED
      407 Proxy Authentication Required — authentication with a proxy is required.
    • REQUEST_TIMEOUT

      public static final HttpStatusCode REQUEST_TIMEOUT
      408 Request Timeout — the server timed out waiting for the request.
    • CONFLICT

      public static final HttpStatusCode CONFLICT
      409 Conflict — the request conflicts with the current resource state.
    • GONE

      public static final HttpStatusCode GONE
      410 Gone — the resource is no longer available and no forwarding address is known.
    • LENGTH_REQUIRED

      public static final HttpStatusCode LENGTH_REQUIRED
      411 Length Required — the request requires a valid Content-Length header.
    • PRECONDITION_FAILED

      public static final HttpStatusCode PRECONDITION_FAILED
      412 Precondition Failed — a request precondition evaluated to false.
    • REQUEST_ENTITY_TOO_LARGE

      public static final HttpStatusCode REQUEST_ENTITY_TOO_LARGE
      413 Request Entity Too Large — the request payload is larger than the server will process.
    • REQUEST_URI_TOO_LONG

      public static final HttpStatusCode REQUEST_URI_TOO_LONG
      414 Request-URI Too Long — the request URI is longer than the server will process.
    • UNSUPPORTED_MEDIA_TYPE

      public static final HttpStatusCode UNSUPPORTED_MEDIA_TYPE
      415 Unsupported Media Type — the request payload format is not supported.
    • REQUESTED_RANGE_NOT_SATISFIABLE

      public static final HttpStatusCode REQUESTED_RANGE_NOT_SATISFIABLE
      416 Requested Range Not Satisfiable — the requested range cannot be served.
    • EXPECTATION_FAILED

      public static final HttpStatusCode EXPECTATION_FAILED
      417 Expectation Failed — the server cannot meet the Expect request-header expectation.
    • PRECONDITION_REQUIRED

      public static final HttpStatusCode PRECONDITION_REQUIRED
      428 Precondition Required — the origin server requires the request to be conditional.
    • TOO_MANY_REQUESTS

      public static final HttpStatusCode TOO_MANY_REQUESTS
      429 Too Many Requests — the user has sent too many requests in a given time.
    • REQUEST_HEADER_FIELDS_TOO_LARGE

      public static final HttpStatusCode REQUEST_HEADER_FIELDS_TOO_LARGE
      431 Request Header Fields Too Large — the request header fields are too large.
    • INTERNAL_SERVER_ERROR

      public static final HttpStatusCode INTERNAL_SERVER_ERROR
      500 Internal Server Error — the server encountered an unexpected condition.
    • NOT_IMPLEMENTED

      public static final HttpStatusCode NOT_IMPLEMENTED
      501 Not Implemented — the server does not support the required functionality.
    • BAD_GATEWAY

      public static final HttpStatusCode BAD_GATEWAY
      502 Bad Gateway — a gateway or proxy received an invalid upstream response.
    • SERVICE_UNAVAILABLE

      public static final HttpStatusCode SERVICE_UNAVAILABLE
      503 Service Unavailable — the server is temporarily unable to handle the request.
    • GATEWAY_TIMEOUT

      public static final HttpStatusCode GATEWAY_TIMEOUT
      504 Gateway Timeout — a gateway or proxy did not receive a timely upstream response.
    • HTTP_VERSION_NOT_SUPPORTED

      public static final HttpStatusCode HTTP_VERSION_NOT_SUPPORTED
      505 HTTP Version Not Supported — the server does not support the request HTTP version.
    • NETWORK_AUTHENTICATION_REQUIRED

      public static final HttpStatusCode NETWORK_AUTHENTICATION_REQUIRED
      511 Network Authentication Required — the client must authenticate to gain network access.
  • Method Details

    • values

      public static HttpStatusCode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static HttpStatusCode 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
    • getFamily

      public HttpStatusCode.Family getFamily()
      Returns the status code family.
      Returns:
      the status code family
    • getStatusCode

      public int getStatusCode()
      Returns the numeric status code.
      Returns:
      the numeric status code
    • getReasonPhrase

      public String getReasonPhrase()
      Returns the reason phrase.
      Returns:
      the reason phrase
    • toString

      public String toString()
      Returns the reason phrase.
      Overrides:
      toString in class Enum<HttpStatusCode>
      Returns:
      the reason phrase
    • fromStatusCode

      public static HttpStatusCode fromStatusCode(int statusCode)
      Returns the enum constant for the given status code.
      Parameters:
      statusCode - the status code
      Returns:
      the matching enum constant, or null if none matches