com.holonplatform.http

## Enum HttpStatus

- java.lang.Object
- - java.lang.Enum<HttpStatus>
  - - com.holonplatform.http.HttpStatus

- All Implemented Interfaces:
    Serializable, Comparable<HttpStatus>

      public enum HttpStatus
      extends Enum<HttpStatus>

  Enumeration of HTTP status codes.
  Since:
    5.0.0

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ACCEPTED` 202 - Accepted
    `ALREADY_REPORTED` 208 - Already reported
    `BAD_GATEWAY` 502 - Bad Gateway
    `BAD_REQUEST` 400 - Bad request
    `BANDWIDTH_LIMIT_EXCEEDED` 509 - Bandwidth Limit Exceeded
    `CHECKPOINT` 103 - Checkpoint
    `CONFLICT` 409 - Conflict
    `CONTINUE` 100 - Continue
    `CREATED` 201 - Created
    `DESTINATION_LOCKED` 421 - Destination Locked
    `EXPECTATION_FAILED` 417 - Expectation Failed
    `FAILED_DEPENDENCY` 424 - Failed Dependency
    `FORBIDDEN` 403 - Forbidden
    `FOUND` 302 - Found
    `GATEWAY_TIMEOUT` 504 - Gateway Timeout
    `GONE` 410 - Gone
    `HTTP_VERSION_NOT_SUPPORTED` 505 - HTTP Version not supported
    `I_AM_A_TEAPOT` 418 - I'm a teapot
    `IM_USED` 226 - IM used
    `INSUFFICIENT_SPACE_ON_RESOURCE` 419 - Insufficient Space On Resource
    `INSUFFICIENT_STORAGE` 507 - Insufficient Storage
    `INTERNAL_SERVER_ERROR` 500 - Internal server error
    `LENGTH_REQUIRED` 411 - Length Required
    `LOCKED` 423 - Locked
    `LOOP_DETECTED` 508 - Loop Detected
    `METHOD_FAILURE` 420 - Method Failure
    `METHOD_NOT_ALLOWED` 405 - Method not allowed
    `MOVED_PERMANENTLY` 301 - Moved Permanently
    `MULTI_STATUS` 207 - Multi-status
    `MULTIPLE_CHOICES` 300 - Multiple Choices
    `NETWORK_AUTHENTICATION_REQUIRED` 511 - Network Authentication Required
    `NO_CONTENT` 204 - No content
    `NON_AUTHORITATIVE_INFORMATION` 203 - Non-Authoritative Information
    `NOT_ACCEPTABLE` 406 - Not acceptable
    `NOT_EXTENDED` 510 - Not Extended
    `NOT_FOUND` 404 - Not found
    `NOT_IMPLEMENTED` 501 - Not Implemented
    `NOT_MODIFIED` 304 - Not modified
    `OK` 200 - OK
    `PARTIAL_CONTENT` 206 - Partial content
    `PAYLOAD_TOO_LARGE` 413 - Payload Too Large
    `PAYMENT_REQUIRED` 402 - Payment Required
    `PERMANENT_REDIRECT` 308 - Permanent Redirect
    `PRECONDITION_FAILED` 412 - Precondition Failed
    `PRECONDITION_REQUIRED` 428 - Precondition Required
    `PROCESSING` 102 - Processing
    `PROXY_AUTHENTICATION_REQUIRED` 407 - Proxy Authentication Required
    `REQUEST_HEADER_FIELDS_TOO_LARGE` 431 - Request Header Fields Too Large
    `REQUEST_TIMEOUT` 408 - Request timeout
    `REQUESTED_RANGE_NOT_SATISFIABLE` 416 - Requested range not satisfiable
    `RESET_CONTENT` 205 - Reset content
    `SEE_OTHER` 303 - See other
    `SERVICE_UNAVAILABLE` 503 - Service Unavailable
    `SWITCHING_PROTOCOLS` 101 - Switching Protocols
    `TEMPORARY_REDIRECT` 307 - Temporary Redirect
    `TOO_MANY_REQUESTS` 429 - Too Many Requests
    `UNAUTHORIZED` 401 - Unauthorized
    `UNAVAILABLE_FOR_LEGAL_REASONS` 451 - Unavailable For Legal Reasons
    `UNPROCESSABLE_ENTITY` 422 - Unprocessable Entity
    `UNSUPPORTED_MEDIA_TYPE` 415 - Unsupported Media Type
    `UPGRADE_REQUIRED` 426 - Upgrade Required
    `URI_TOO_LONG` 414 - URI too long
    `VARIANT_ALSO_NEGOTIATES` 506 - Variant Also Negotiates

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getCode()` Get the status numeric code
    `String` | `getDescription()` Get the status description
    `static boolean` | `isRedirectionStatusCode(int statusCode)` Gets whether given `statusCode` is a redirection, i.e.
    `static boolean` | `isSuccessStatusCode(int statusCode)` Gets whether given `statusCode` is a success, i.e.
    `static Optional<HttpStatus>` | `of(int code)` Get the `HttpStatus` which corresponds to given status code, if any
    `String` | `toString()`
    `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

      `compareTo, equals, 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

      100 - Continue

    - #### SWITCHING_PROTOCOLS

          public static final HttpStatus SWITCHING_PROTOCOLS

      101 - Switching Protocols

    - #### PROCESSING

          public static final HttpStatus PROCESSING

      102 - Processing

    - #### CHECKPOINT

          public static final HttpStatus CHECKPOINT

      103 - Checkpoint

    - #### OK

          public static final HttpStatus OK

      200 - OK

    - #### CREATED

          public static final HttpStatus CREATED

      201 - Created

    - #### ACCEPTED

          public static final HttpStatus ACCEPTED

      202 - Accepted

    - #### NON_AUTHORITATIVE_INFORMATION

          public static final HttpStatus NON_AUTHORITATIVE_INFORMATION

      203 - Non-Authoritative Information

    - #### NO_CONTENT

          public static final HttpStatus NO_CONTENT

      204 - No content

    - #### RESET_CONTENT

          public static final HttpStatus RESET_CONTENT

      205 - Reset content

    - #### PARTIAL_CONTENT

          public static final HttpStatus PARTIAL_CONTENT

      206 - Partial content

    - #### MULTI_STATUS

          public static final HttpStatus MULTI_STATUS

      207 - Multi-status

    - #### ALREADY_REPORTED

          public static final HttpStatus ALREADY_REPORTED

      208 - Already reported

    - #### IM_USED

          public static final HttpStatus IM_USED

      226 - IM used

    - #### MULTIPLE_CHOICES

          public static final HttpStatus MULTIPLE_CHOICES

      300 - Multiple Choices

    - #### MOVED_PERMANENTLY

          public static final HttpStatus MOVED_PERMANENTLY

      301 - Moved Permanently

    - #### FOUND

          public static final HttpStatus FOUND

      302 - Found

    - #### SEE_OTHER

          public static final HttpStatus SEE_OTHER

      303 - See other

    - #### NOT_MODIFIED

          public static final HttpStatus NOT_MODIFIED

      304 - Not modified

    - #### TEMPORARY_REDIRECT

          public static final HttpStatus TEMPORARY_REDIRECT

      307 - Temporary Redirect

    - #### PERMANENT_REDIRECT

          public static final HttpStatus PERMANENT_REDIRECT

      308 - Permanent Redirect

    - #### BAD_REQUEST

          public static final HttpStatus BAD_REQUEST

      400 - Bad request

    - #### UNAUTHORIZED

          public static final HttpStatus UNAUTHORIZED

      401 - Unauthorized

    - #### PAYMENT_REQUIRED

          public static final HttpStatus PAYMENT_REQUIRED

      402 - Payment Required

    - #### FORBIDDEN

          public static final HttpStatus FORBIDDEN

      403 - Forbidden

    - #### NOT_FOUND

          public static final HttpStatus NOT_FOUND

      404 - Not found

    - #### METHOD_NOT_ALLOWED

          public static final HttpStatus METHOD_NOT_ALLOWED

      405 - Method not allowed

    - #### NOT_ACCEPTABLE

          public static final HttpStatus NOT_ACCEPTABLE

      406 - Not acceptable

    - #### PROXY_AUTHENTICATION_REQUIRED

          public static final HttpStatus PROXY_AUTHENTICATION_REQUIRED

      407 - Proxy Authentication Required

    - #### REQUEST_TIMEOUT

          public static final HttpStatus REQUEST_TIMEOUT

      408 - Request timeout

    - #### CONFLICT

          public static final HttpStatus CONFLICT

      409 - Conflict

    - #### GONE

          public static final HttpStatus GONE

      410 - Gone

    - #### LENGTH_REQUIRED

          public static final HttpStatus LENGTH_REQUIRED

      411 - Length Required

    - #### PRECONDITION_FAILED

          public static final HttpStatus PRECONDITION_FAILED

      412 - Precondition Failed

    - #### PAYLOAD_TOO_LARGE

          public static final HttpStatus PAYLOAD_TOO_LARGE

      413 - Payload Too Large

    - #### URI_TOO_LONG

          public static final HttpStatus URI_TOO_LONG

      414 - URI too long

    - #### UNSUPPORTED_MEDIA_TYPE

          public static final HttpStatus UNSUPPORTED_MEDIA_TYPE

      415 - Unsupported Media Type

    - #### REQUESTED_RANGE_NOT_SATISFIABLE

          public static final HttpStatus REQUESTED_RANGE_NOT_SATISFIABLE

      416 - Requested range not satisfiable

    - #### EXPECTATION_FAILED

          public static final HttpStatus EXPECTATION_FAILED

      417 - Expectation Failed

    - #### I_AM_A_TEAPOT

          public static final HttpStatus I_AM_A_TEAPOT

      418 - I'm a teapot

    - #### INSUFFICIENT_SPACE_ON_RESOURCE

          public static final HttpStatus INSUFFICIENT_SPACE_ON_RESOURCE

      419 - Insufficient Space On Resource

    - #### METHOD_FAILURE

          public static final HttpStatus METHOD_FAILURE

      420 - Method Failure

    - #### DESTINATION_LOCKED

          public static final HttpStatus DESTINATION_LOCKED

      421 - Destination Locked

    - #### UNPROCESSABLE_ENTITY

          public static final HttpStatus UNPROCESSABLE_ENTITY

      422 - Unprocessable Entity

    - #### LOCKED

          public static final HttpStatus LOCKED

      423 - Locked

    - #### FAILED_DEPENDENCY

          public static final HttpStatus FAILED_DEPENDENCY

      424 - Failed Dependency

    - #### UPGRADE_REQUIRED

          public static final HttpStatus UPGRADE_REQUIRED

      426 - Upgrade Required

    - #### PRECONDITION_REQUIRED

          public static final HttpStatus PRECONDITION_REQUIRED

      428 - Precondition Required

    - #### TOO_MANY_REQUESTS

          public static final HttpStatus TOO_MANY_REQUESTS

      429 - Too Many Requests

    - #### REQUEST_HEADER_FIELDS_TOO_LARGE

          public static final HttpStatus REQUEST_HEADER_FIELDS_TOO_LARGE

      431 - Request Header Fields Too Large

    - #### UNAVAILABLE_FOR_LEGAL_REASONS

          public static final HttpStatus UNAVAILABLE_FOR_LEGAL_REASONS

      451 - Unavailable For Legal Reasons

    - #### INTERNAL_SERVER_ERROR

          public static final HttpStatus INTERNAL_SERVER_ERROR

      500 - Internal server error

    - #### NOT_IMPLEMENTED

          public static final HttpStatus NOT_IMPLEMENTED

      501 - Not Implemented

    - #### BAD_GATEWAY

          public static final HttpStatus BAD_GATEWAY

      502 - Bad Gateway

    - #### SERVICE_UNAVAILABLE

          public static final HttpStatus SERVICE_UNAVAILABLE

      503 - Service Unavailable

    - #### GATEWAY_TIMEOUT

          public static final HttpStatus GATEWAY_TIMEOUT

      504 - Gateway Timeout

    - #### HTTP_VERSION_NOT_SUPPORTED

          public static final HttpStatus HTTP_VERSION_NOT_SUPPORTED

      505 - HTTP Version not supported

    - #### VARIANT_ALSO_NEGOTIATES

          public static final HttpStatus VARIANT_ALSO_NEGOTIATES

      506 - Variant Also Negotiates

    - #### INSUFFICIENT_STORAGE

          public static final HttpStatus INSUFFICIENT_STORAGE

      507 - Insufficient Storage

    - #### LOOP_DETECTED

          public static final HttpStatus LOOP_DETECTED

      508 - Loop Detected

    - #### BANDWIDTH_LIMIT_EXCEEDED

          public static final HttpStatus BANDWIDTH_LIMIT_EXCEEDED

      509 - Bandwidth Limit Exceeded

    - #### NOT_EXTENDED

          public static final HttpStatus NOT_EXTENDED

      510 - Not Extended

    - #### NETWORK_AUTHENTICATION_REQUIRED

          public static final HttpStatus NETWORK_AUTHENTICATION_REQUIRED

      511 - Network Authentication Required

  - ### 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

    - #### getCode

          public int getCode()

      Get the status numeric code
      Returns:
        the status code

    - #### getDescription

          public String getDescription()

      Get the status description
      Returns:
        the status description

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Enum<HttpStatus>`

    - #### of

          public static Optional<HttpStatus> of(int code)

      Get the `HttpStatus` which corresponds to given status code, if any
      Parameters:
        `code` - Status code
      Returns:
        HttpStatus which corresponds to given code, or an empty Optional if the given code does not corresponds to any of the `HttpStatus` values.

    - #### isSuccessStatusCode

          public static boolean isSuccessStatusCode(int statusCode)

      Gets whether given `statusCode` is a success, i.e. a `2xx` status code
      Parameters:
        `statusCode` - Status code
      Returns:
        `true` if given `statusCode` is a success status code

    - #### isRedirectionStatusCode

          public static boolean isRedirectionStatusCode(int statusCode)

      Gets whether given `statusCode` is a redirection, i.e. a `3xx` status code
      Parameters:
        `statusCode` - Status code
      Returns:
        `true` if given `statusCode` is a redirection status code

Copyright © 2019 The Holon Platform. All rights reserved.