Package org.apache.hc.core5.http
Class HttpVersion
java.lang.Object
org.apache.hc.core5.http.ProtocolVersion
org.apache.hc.core5.http.HttpVersion
- All Implemented Interfaces:
Serializable
Represents an HTTP version. HTTP uses a "major.minor" numbering
scheme to indicate versions of the protocol.
The version of an HTTP message is indicated by an HTTP-Version field in the first line of the message.
- Since:
- 4.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HttpVersion[]All HTTP versions known to HttpCore.static final HttpVersionHTTP/1.1 is defaultstatic final StringThe protocol name.static final HttpVersionHTTP protocol version 0.9static final HttpVersionHTTP protocol version 1.0static final HttpVersionHTTP protocol version 1.1static final HttpVersionstatic final HttpVersionHTTP protocol version 2.0private static final long -
Constructor Summary
ConstructorsConstructorDescriptionHttpVersion(int major, int minor) Creates an HTTP protocol version designator. -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpVersionget(int major, int minor) Gets a specific instance or creates a new one.Methods inherited from class org.apache.hc.core5.http.ProtocolVersion
compareToVersion, equals, equals, format, getMajor, getMinor, getProtocol, greaterEquals, hashCode, isComparable, lessEquals, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
HTTP
The protocol name.- See Also:
-
HTTP_0_9
HTTP protocol version 0.9 -
HTTP_1_0
HTTP protocol version 1.0 -
HTTP_1_1
HTTP protocol version 1.1 -
HTTP_2_0
HTTP protocol version 2.0 -
HTTP_2
-
DEFAULT
HTTP/1.1 is default -
ALL
All HTTP versions known to HttpCore.
-
-
Constructor Details
-
HttpVersion
public HttpVersion(int major, int minor) Creates an HTTP protocol version designator.- Parameters:
major- the major version number of the HTTP protocolminor- the minor version number of the HTTP protocol- Throws:
IllegalArgumentException- if either major or minor version number is negative
-
-
Method Details
-
get
Gets a specific instance or creates a new one.- Parameters:
major- the major versionminor- the minor version- Returns:
- an instance of
HttpVersionwith the argument version, never null. - Throws:
IllegalArgumentException- if either major or minor version number is negative- Since:
- 5.0
-