Package org.apache.http
Class HttpVersion
- java.lang.Object
-
- org.apache.http.ProtocolVersion
-
- org.apache.http.HttpVersion
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
@Contract(threading=IMMUTABLE) public final class HttpVersion extends ProtocolVersion implements java.io.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.
HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT
- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
HTTP
The protocol name.static HttpVersion
HTTP_0_9
HTTP protocol version 0.9static HttpVersion
HTTP_1_0
HTTP protocol version 1.0static HttpVersion
HTTP_1_1
HTTP protocol version 1.1
-
Constructor Summary
Constructors Constructor Description HttpVersion(int major, int minor)
Create an HTTP protocol version designator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProtocolVersion
forVersion(int major, int minor)
Obtains a specific HTTP version.-
Methods inherited from class org.apache.http.ProtocolVersion
clone, compareToVersion, equals, getMajor, getMinor, getProtocol, greaterEquals, hashCode, isComparable, lessEquals, toString
-
-
-
-
Field Detail
-
HTTP
public static final java.lang.String HTTP
The protocol name.- See Also:
- Constant Field Values
-
HTTP_0_9
public static final HttpVersion HTTP_0_9
HTTP protocol version 0.9
-
HTTP_1_0
public static final HttpVersion HTTP_1_0
HTTP protocol version 1.0
-
HTTP_1_1
public static final HttpVersion HTTP_1_1
HTTP protocol version 1.1
-
-
Constructor Detail
-
HttpVersion
public HttpVersion(int major, int minor)
Create an HTTP protocol version designator.- Parameters:
major
- the major version number of the HTTP protocolminor
- the minor version number of the HTTP protocol- Throws:
java.lang.IllegalArgumentException
- if either major or minor version number is negative
-
-
Method Detail
-
forVersion
public ProtocolVersion forVersion(int major, int minor)
Obtains a specific HTTP version.- Overrides:
forVersion
in classProtocolVersion
- Parameters:
major
- the major versionminor
- the minor version- Returns:
- an instance of
HttpVersion
with the argument version
-
-