public class HttpVersion extends java.lang.Object implements java.lang.Comparable<HttpVersion>
限定符和类型 | 字段和说明 |
---|---|
static HttpVersion |
HTTP_1_0
HTTP/1.0
|
static HttpVersion |
HTTP_1_1
HTTP/1.1
|
构造器和说明 |
---|
HttpVersion(java.lang.String text,
boolean keepAliveDefault)
Creates a new HTTP version with the specified version string.
|
HttpVersion(java.lang.String protocolName,
int majorVersion,
int minorVersion,
boolean keepAliveDefault)
Creates a new HTTP version with the specified protocol name and version
numbers.
|
限定符和类型 | 方法和说明 |
---|---|
int |
compareTo(HttpVersion o) |
boolean |
equals(java.lang.Object o) |
int |
getMajorVersion()
Returns the name of the protocol such as
1 in "HTTP/1.0" . |
int |
getMinorVersion()
Returns the name of the protocol such as
0 in "HTTP/1.0" . |
java.lang.String |
getProtocolName()
Returns the name of the protocol such as
"HTTP" in "HTTP/1.0" . |
java.lang.String |
getText()
Returns the full protocol version text such as
"HTTP/1.0" . |
int |
hashCode() |
boolean |
isKeepAliveDefault()
Returns
true if and only if the connection is kept alive unless
the "Connection" header is set to "close" explicitly. |
java.lang.String |
toString()
Returns the full protocol version text such as
"HTTP/1.0" . |
static HttpVersion |
valueOf(java.lang.String text)
Returns an existing or new
HttpVersion instance which matches to
the specified protocol version string. |
public static final HttpVersion HTTP_1_0
public static final HttpVersion HTTP_1_1
public HttpVersion(java.lang.String text, boolean keepAliveDefault)
keepAliveDefault
- true
if and only if the connection is kept alive unless
the "Connection"
header is set to "close"
explicitly.public HttpVersion(java.lang.String protocolName, int majorVersion, int minorVersion, boolean keepAliveDefault)
keepAliveDefault
- true
if and only if the connection is kept alive unless
the "Connection"
header is set to "close"
explicitly.public static HttpVersion valueOf(java.lang.String text)
HttpVersion
instance which matches to
the specified protocol version string. If the specified text
is
equal to "HTTP/1.0"
, HTTP_1_0
will be returned. If the
specified text
is equal to "HTTP/1.1"
, HTTP_1_1
will be returned. Otherwise, a new HttpVersion
instance will be
returned.public java.lang.String getProtocolName()
"HTTP"
in "HTTP/1.0"
.public int getMajorVersion()
1
in "HTTP/1.0"
.public int getMinorVersion()
0
in "HTTP/1.0"
.public java.lang.String getText()
"HTTP/1.0"
.public boolean isKeepAliveDefault()
true
if and only if the connection is kept alive unless
the "Connection"
header is set to "close"
explicitly.public java.lang.String toString()
"HTTP/1.0"
.toString
在类中 java.lang.Object
public int hashCode()
hashCode
在类中 java.lang.Object
public boolean equals(java.lang.Object o)
equals
在类中 java.lang.Object
public int compareTo(HttpVersion o)
compareTo
在接口中 java.lang.Comparable<HttpVersion>