public class HttpVersion extends Object
HTTP-Version
data object, as found in RFC
2616. It is immutable.Modifier and Type | Field and Description |
---|---|
static String |
HTTP_VERSION_BEGIN
The string
HTTP/ . |
static HttpVersion |
HTTP10
Represents HTTP version 1.0
|
static HttpVersion |
HTTP11
Represents HTTP version 1.1
|
Constructor and Description |
---|
HttpVersion(int major,
int minor)
Constructs a
HttpVersionImpl out of version number parts. |
HttpVersion(String line)
Constructs a
HttpVersionImpl out of a parsable String. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Returns true if the other object is an HttpVersion with the same minor
and major versions.
|
int |
getMajorVersion()
Returns the major version number in use.
|
int |
getMinorVersion()
Returns the minor version number in use.
|
int |
hashCode()
Returns the hashcode.
|
static HttpVersion |
parseVersion(String version)
Based on the string supplied, returns either
HttpVersion.HTTP10 or HttpVersion.HTTP11 or
a newly constructed HttpVersion instance. |
String |
toString()
Returns
|
public static final HttpVersion HTTP11
public static final HttpVersion HTTP10
public static final String HTTP_VERSION_BEGIN
HTTP/
.public HttpVersion(String line) throws HttpException
HttpVersionImpl
out of a parsable String.HttpException
public HttpVersion(int major, int minor)
HttpVersionImpl
out of version number parts.public static HttpVersion parseVersion(String version) throws HttpException
HttpVersion.HTTP10
or HttpVersion.HTTP11
or
a newly constructed HttpVersion
instance.HttpException
public int getMinorVersion()
public int getMajorVersion()
public String toString()
HTTP_VERSION_BEGIN + getMinorVersion() + '.' + getMajorVersion()
public boolean equals(Object other)
Copyright © 2013. All Rights Reserved.