@Contract(threading=IMMUTABLE) public final class HttpVersion extends ProtocolVersion
The version of an HTTP message is indicated by an HTTP-Version field in the first line of the message.
Modifier and Type | Field and Description |
---|---|
static HttpVersion[] |
ALL
All HTTP versions known to HttpCore.
|
static HttpVersion |
DEFAULT
HTTP/1.1 is default
|
static String |
HTTP
The protocol name.
|
static HttpVersion |
HTTP_0_9
HTTP protocol version 0.9
|
static HttpVersion |
HTTP_1_0
HTTP protocol version 1.0
|
static HttpVersion |
HTTP_1_1
HTTP protocol version 1.1
|
static HttpVersion |
HTTP_2 |
static HttpVersion |
HTTP_2_0
HTTP protocol version 2.0
|
Constructor and Description |
---|
HttpVersion(int major,
int minor)
Creates an HTTP protocol version designator.
|
Modifier and Type | Method and Description |
---|---|
static HttpVersion |
get(int major,
int minor)
Gets a specific instance or creates a new one.
|
compareToVersion, equals, equals, format, getMajor, getMinor, getProtocol, greaterEquals, hashCode, isComparable, lessEquals, toString
public static final HttpVersion[] ALL
public static final HttpVersion DEFAULT
public static final String HTTP
public static final HttpVersion HTTP_0_9
public static final HttpVersion HTTP_1_0
public static final HttpVersion HTTP_1_1
public static final HttpVersion HTTP_2
public static final HttpVersion HTTP_2_0
public HttpVersion(int major, int minor)
major
- the major version number of the HTTP protocolminor
- the minor version number of the HTTP protocolIllegalArgumentException
- if either major or minor version number is negativepublic static HttpVersion get(int major, int minor)
major
- the major versionminor
- the minor versionHttpVersion
with the argument version, never null.IllegalArgumentException
- if either major or minor version number is negative