Package org.asynchttpclient
Enum HttpProtocol
- java.lang.Object
-
- java.lang.Enum<HttpProtocol>
-
- org.asynchttpclient.HttpProtocol
-
- All Implemented Interfaces:
Serializable,Comparable<HttpProtocol>
public enum HttpProtocol extends Enum<HttpProtocol>
HTTP protocol version used for a request/response exchange.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetText()StringtoString()static HttpProtocolvalueOf(String name)Returns the enum constant of this type with the specified name.static HttpProtocol[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HTTP_1_0
public static final HttpProtocol HTTP_1_0
-
HTTP_1_1
public static final HttpProtocol HTTP_1_1
-
HTTP_2
public static final HttpProtocol HTTP_2
-
-
Method Detail
-
values
public static HttpProtocol[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HttpProtocol c : HttpProtocol.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpProtocol valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getText
public String getText()
- Returns:
- the protocol version string (e.g. "HTTP/1.1", "HTTP/2")
-
toString
public String toString()
- Overrides:
toStringin classEnum<HttpProtocol>
-
-