public final class HttpProtocolVersion extends java.lang.Object implements HttpConnectionContext.HttpProtocol
Modifier and Type | Field and Description |
---|---|
static HttpProtocolVersion |
HTTP_1_0
HTTP/1.0 version described in RFC 1945.
|
static HttpProtocolVersion |
HTTP_1_1
HTTP/1.1 version described in RFC 7230.
|
static HttpProtocolVersion |
HTTP_2_0
HTTP/2.0 version described in RFC 7540.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
int |
major()
Get the <major> portion of the
http protocol version.
|
int |
minor()
Get the <minor> portion of the
http protocol version.
|
java.lang.String |
name()
Returns name of the protocol.
|
static HttpProtocolVersion |
of(int major,
int minor)
|
java.lang.String |
toString() |
void |
writeTo(Buffer buffer)
Write the equivalent of this
HttpProtocolVersion to a Buffer . |
public static final HttpProtocolVersion HTTP_1_1
public static final HttpProtocolVersion HTTP_1_0
public static final HttpProtocolVersion HTTP_2_0
public static HttpProtocolVersion of(int major, int minor)
HttpProtocolVersion
for the specified major
and minor
.
Generally, the constants in HttpProtocolVersion
should be used.major
- the <major> portion of the
HTTP protocol versionminor
- the <minor> portion of the
HTTP protocol versionHttpProtocolVersion
java.lang.IllegalArgumentException
- if major
or minor
is not a 1-digit integerpublic int major()
public int minor()
public void writeTo(Buffer buffer)
HttpProtocolVersion
to a Buffer
.buffer
- the Buffer
to write topublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String name()
ConnectionInfo.Protocol
name
in interface ConnectionInfo.Protocol