public class HttpVersion extends Object implements Comparable<HttpVersion>
| 限定符和类型 | 字段和说明 |
|---|---|
static HttpVersion |
HTTP_1_0
HTTP/1.0
|
static HttpVersion |
HTTP_1_1
HTTP/1.1
|
| 构造器和说明 |
|---|
HttpVersion(String text,
boolean keepAliveDefault) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(HttpVersion o) |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isKeepAliveDefault()
Returns
true if and only if the connection is kept alive unless
the "Connection" header is set to "close" explicitly. |
int |
majorVersion()
Returns the name of the protocol such as
1 in "HTTP/1.0". |
int |
minorVersion()
Returns the name of the protocol such as
0 in "HTTP/1.0". |
String |
protocolName()
Returns the name of the protocol such as
"HTTP" in "HTTP/1.0". |
String |
text()
Returns the full protocol version text such as
"HTTP/1.0". |
String |
toString()
Returns the full protocol version text such as
"HTTP/1.0". |
static HttpVersion |
valueOf(String text) |
public static final HttpVersion HTTP_1_0
public static final HttpVersion HTTP_1_1
public HttpVersion(String text, boolean keepAliveDefault)
public static HttpVersion valueOf(String text)
public String protocolName()
"HTTP" in "HTTP/1.0".public int majorVersion()
1 in "HTTP/1.0".public int minorVersion()
0 in "HTTP/1.0".public String text()
"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 String toString()
"HTTP/1.0".public int compareTo(HttpVersion o)
compareTo 在接口中 Comparable<HttpVersion>Copyright © 2021. All rights reserved.