public final class HttpProtocolVersion
extends Object
implements ConnectionInfo.Protocol
| 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(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.
|
String |
name() |
static HttpProtocolVersion |
of(int major,
int minor)
|
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 versionHttpProtocolVersionIllegalArgumentException - 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(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic String name()
name in interface ConnectionInfo.Protocol