org.jboss.netty.handler.codec.http
类 HttpVersion

java.lang.Object
  继承者 org.jboss.netty.handler.codec.http.HttpVersion
所有已实现的接口:
java.lang.Comparable<HttpVersion>

public class HttpVersion
extends java.lang.Object
implements java.lang.Comparable<HttpVersion>

The version of HTTP or its derived protocols, such as RTSP and ICAP.


字段摘要
static HttpVersion HTTP_1_0
          HTTP/1.0
static HttpVersion HTTP_1_1
          HTTP/1.1
 
构造方法摘要
HttpVersion(java.lang.String text)
          已过时。 Use HttpVersion(String, boolean) instead.
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)
          已过时。 Use HttpVersion(String, int, int, boolean) instead.
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.
 
从类 java.lang.Object 继承的方法
getClass, notify, notifyAll, wait, wait, wait
 

字段详细信息

HTTP_1_0

public static final HttpVersion HTTP_1_0
HTTP/1.0


HTTP_1_1

public static final HttpVersion HTTP_1_1
HTTP/1.1

构造方法详细信息

HttpVersion

@Deprecated
public HttpVersion(java.lang.String text)
已过时。 Use HttpVersion(String, boolean) instead.


HttpVersion

public HttpVersion(java.lang.String text,
                   boolean keepAliveDefault)
Creates a new HTTP version with the specified version string. You will not need to create a new instance unless you are implementing a protocol derived from HTTP, such as RTSP and ICAP.

参数:
keepAliveDefault - true if and only if the connection is kept alive unless the "Connection" header is set to "close" explicitly.

HttpVersion

@Deprecated
public HttpVersion(java.lang.String protocolName,
                              int majorVersion,
                              int minorVersion)
已过时。 Use HttpVersion(String, int, int, boolean) instead.


HttpVersion

public HttpVersion(java.lang.String protocolName,
                   int majorVersion,
                   int minorVersion,
                   boolean keepAliveDefault)
Creates a new HTTP version with the specified protocol name and version numbers. You will not need to create a new instance unless you are implementing a protocol derived from HTTP, such as RTSP and ICAP

参数:
keepAliveDefault - true if and only if the connection is kept alive unless the "Connection" header is set to "close" explicitly.
方法详细信息

valueOf

public static HttpVersion valueOf(java.lang.String text)
Returns an existing or new 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.


getProtocolName

public java.lang.String getProtocolName()
Returns the name of the protocol such as "HTTP" in "HTTP/1.0".


getMajorVersion

public int getMajorVersion()
Returns the name of the protocol such as 1 in "HTTP/1.0".


getMinorVersion

public int getMinorVersion()
Returns the name of the protocol such as 0 in "HTTP/1.0".


getText

public java.lang.String getText()
Returns the full protocol version text such as "HTTP/1.0".


isKeepAliveDefault

public boolean isKeepAliveDefault()
Returns true if and only if the connection is kept alive unless the "Connection" header is set to "close" explicitly.


toString

public java.lang.String toString()
Returns the full protocol version text such as "HTTP/1.0".

覆盖:
java.lang.Object 中的 toString

hashCode

public int hashCode()
覆盖:
java.lang.Object 中的 hashCode

equals

public boolean equals(java.lang.Object o)
覆盖:
java.lang.Object 中的 equals

compareTo

public int compareTo(HttpVersion o)
指定者:
接口 java.lang.Comparable<HttpVersion> 中的 compareTo