Package dev.relism.flash.http
Enum Class HttpStatus
- All Implemented Interfaces:
Serializable,Comparable<HttpStatus>,Constable
Pre-compiled byte representations of standard HTTP status lines.
Uses a direct-access array for O(1) lookup with zero allocation.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()Pre-encoded"200 OK"bytes — zero allocation on the write path.static byte[]bytesForCode(int code) Returns pre-compiled status bytes for the given code.intcode()Numeric status code (e.g.reason()Reason phrase (e.g.static StringreasonForCode(int code) Returns reason phrase for the given code, or null if unknown.static HttpStatusReturns the enum constant of this class with the specified name.static HttpStatus[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONTINUE
-
SWITCHING_PROTOCOLS
-
OK
-
CREATED
-
ACCEPTED
-
NO_CONTENT
-
PARTIAL_CONTENT
-
MOVED_PERMANENTLY
-
FOUND
-
NOT_MODIFIED
-
TEMPORARY_REDIRECT
-
PERMANENT_REDIRECT
-
BAD_REQUEST
-
UNAUTHORIZED
-
FORBIDDEN
-
NOT_FOUND
-
METHOD_NOT_ALLOWED
-
NOT_ACCEPTABLE
-
CONFLICT
-
GONE
-
LENGTH_REQUIRED
-
PAYLOAD_TOO_LARGE
-
URI_TOO_LONG
-
UNSUPPORTED_MEDIA_TYPE
-
UNPROCESSABLE_ENTITY
-
TOO_MANY_REQUESTS
-
INTERNAL_SERVER_ERROR
-
NOT_IMPLEMENTED
-
BAD_GATEWAY
-
SERVICE_UNAVAILABLE
-
GATEWAY_TIMEOUT
-
-
Method Details
-
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
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 nameNullPointerException- 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
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
Returns reason phrase for the given code, or null if unknown.
-