@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[] | ALLAll HTTP versions known to HttpCore. | 
| static HttpVersion | DEFAULTHTTP/1.1 is default | 
| static String | HTTPThe protocol name. | 
| static HttpVersion | HTTP_0_9HTTP protocol version 0.9 | 
| static HttpVersion | HTTP_1_0HTTP protocol version 1.0 | 
| static HttpVersion | HTTP_1_1HTTP protocol version 1.1 | 
| static HttpVersion | HTTP_2 | 
| static HttpVersion | HTTP_2_0HTTP 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, toStringpublic 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_0
public static final HttpVersion HTTP_2
public static final HttpVersion DEFAULT
public static final HttpVersion[] ALL
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 negativeCopyright © 2005–2022 The Apache Software Foundation. All rights reserved.