- All Implemented Interfaces:
Serializable,Comparable<Http2ErrorCode>,Constable
Represents an HTTP/2 error code, as defined in RFC 7540, Section 7.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe stream is no longer needed.The endpoint is unable to maintain the header compression context for the connection.The connection established in response to a CONNECT request was reset or abnormally closed.The endpoint detected that its peer is exhibiting a behavior that might be generating excessive load.The endpoint detected that its peer violated the flow-control protocol.The endpoint requires that HTTP/1.1 be used instead of HTTP/2.The underlying transport has properties that do not meet the minimum security requirements.The endpoint encountered an unexpected internal error.The associated condition is not a result of an error.The endpoint detected an unspecific protocol error.The endpoint refuses the stream prior to processing any application logic. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Http2ErrorCodefromHttp2(int code) Returns theHttp2ErrorCodecorresponding to the given HTTP/2 code.static Http2ErrorCodeReturns the enum constant of this class with the specified name.static Http2ErrorCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO_ERROR
The associated condition is not a result of an error. -
PROTOCOL_ERROR
The endpoint detected an unspecific protocol error. -
INTERNAL_ERROR
The endpoint encountered an unexpected internal error. -
FLOW_CONTROL_ERROR
The endpoint detected that its peer violated the flow-control protocol. -
REFUSED_STREAM
The endpoint refuses the stream prior to processing any application logic. -
CANCEL
The stream is no longer needed. -
COMPRESSION_ERROR
The endpoint is unable to maintain the header compression context for the connection. -
CONNECT_ERROR
The connection established in response to a CONNECT request was reset or abnormally closed. -
ENHANCE_YOUR_CALM
The endpoint detected that its peer is exhibiting a behavior that might be generating excessive load. -
INADEQUATE_SECURITY
The underlying transport has properties that do not meet the minimum security requirements. -
HTTP_1_1_REQUIRED
The endpoint requires that HTTP/1.1 be used instead of HTTP/2.
-
-
Field Details
-
httpCode
public final int httpCodeThe HTTP/2 error code as an integer.
-
-
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
-
fromHttp2
Returns theHttp2ErrorCodecorresponding to the given HTTP/2 code.- Parameters:
code- The HTTP/2 error code.- Returns:
- The corresponding
Http2ErrorCode, or null if not found.
-