Enum Class HttpStatus

java.lang.Object
java.lang.Enum<HttpStatus>
dev.relism.flash.http.HttpStatus
All Implemented Interfaces:
Serializable, Comparable<HttpStatus>, Constable

public enum HttpStatus extends Enum<HttpStatus>
Pre-compiled byte representations of standard HTTP status lines. Uses a direct-access array for O(1) lookup with zero allocation.
  • Enum Constant Details

    • 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
    • NO_CONTENT

      public static final HttpStatus NO_CONTENT
    • PARTIAL_CONTENT

      public static final HttpStatus PARTIAL_CONTENT
    • MOVED_PERMANENTLY

      public static final HttpStatus MOVED_PERMANENTLY
    • FOUND

      public static final HttpStatus FOUND
    • NOT_MODIFIED

      public static final HttpStatus NOT_MODIFIED
    • TEMPORARY_REDIRECT

      public static final HttpStatus TEMPORARY_REDIRECT
    • PERMANENT_REDIRECT

      public static final HttpStatus PERMANENT_REDIRECT
    • BAD_REQUEST

      public static final HttpStatus BAD_REQUEST
    • UNAUTHORIZED

      public static final HttpStatus UNAUTHORIZED
    • 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
    • CONFLICT

      public static final HttpStatus CONFLICT
    • GONE

      public static final HttpStatus GONE
    • LENGTH_REQUIRED

      public static final HttpStatus LENGTH_REQUIRED
    • PAYLOAD_TOO_LARGE

      public static final HttpStatus PAYLOAD_TOO_LARGE
    • URI_TOO_LONG

      public static final HttpStatus URI_TOO_LONG
    • UNSUPPORTED_MEDIA_TYPE

      public static final HttpStatus UNSUPPORTED_MEDIA_TYPE
    • UNPROCESSABLE_ENTITY

      public static final HttpStatus UNPROCESSABLE_ENTITY
    • TOO_MANY_REQUESTS

      public static final HttpStatus TOO_MANY_REQUESTS
    • 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
  • Method Details

    • values

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

      public static HttpStatus valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • code

      public int code()
      Numeric status code (e.g. 200).
    • bytes

      public byte[] bytes()
      Pre-encoded "200 OK" bytes — zero allocation on the write path.
    • reason

      public String reason()
      Reason phrase (e.g. "OK").
    • bytesForCode

      public static byte[] bytesForCode(int code)
      Returns pre-compiled status bytes for the given code. Access is O(1) and generates zero garbage.
    • reasonForCode

      public static String reasonForCode(int code)
      Returns reason phrase for the given code, or null if unknown.