Package org.swisspush.gateleen.core.util
Enum HttpRequestHeader
- java.lang.Object
-
- java.lang.Enum<HttpRequestHeader>
-
- org.swisspush.gateleen.core.util.HttpRequestHeader
-
- All Implemented Interfaces:
Serializable,Comparable<HttpRequestHeader>
public enum HttpRequestHeader extends Enum<HttpRequestHeader>
Enum for HTTP request headers used in gateleen- Author:
- https://github.com/mcweba [Marc-Andre Weber]
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONNECTIONCONTENT_LENGTHX_HOPS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancontainsHeader(io.vertx.core.MultiMap headers, HttpRequestHeader httpRequestHeader)static IntegergetInteger(io.vertx.core.MultiMap headers, HttpRequestHeader httpRequestHeader)Get the value of the providedHttpRequestHeaderas Integer.static IntegergetInteger(io.vertx.core.MultiMap headers, HttpRequestHeader httpRequestHeader, Integer defaultValue)Get the value of the providedHttpRequestHeaderor a default value as Integer.StringgetName()static StringgetString(io.vertx.core.MultiMap headers, HttpRequestHeader httpRequestHeader)Get the value of the providedHttpRequestHeaderas String.static HttpRequestHeadervalueOf(String name)Returns the enum constant of this type with the specified name.static HttpRequestHeader[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CONNECTION
public static final HttpRequestHeader CONNECTION
-
CONTENT_LENGTH
public static final HttpRequestHeader CONTENT_LENGTH
-
X_HOPS
public static final HttpRequestHeader X_HOPS
-
-
Method Detail
-
values
public static HttpRequestHeader[] 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 (HttpRequestHeader c : HttpRequestHeader.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpRequestHeader 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
-
getName
public String getName()
-
containsHeader
public static boolean containsHeader(io.vertx.core.MultiMap headers, HttpRequestHeader httpRequestHeader)
-
getInteger
public static Integer getInteger(io.vertx.core.MultiMap headers, HttpRequestHeader httpRequestHeader)
Get the value of the providedHttpRequestHeaderas Integer.Returns
nullin the following cases:- headers are
null - headers does not contain httpRequestHeader
- httpRequestHeader is no parsable Integer i.e. empty string, non-digit characters, numbers to bigger than Integer allows
- Parameters:
headers- the http request headershttpRequestHeader- the http request header to get the value from- Returns:
- an Integer representing the value of the httpRequestHeader or null
- headers are
-
getInteger
public static Integer getInteger(io.vertx.core.MultiMap headers, HttpRequestHeader httpRequestHeader, Integer defaultValue)
Get the value of the providedHttpRequestHeaderor a default value as Integer.Returns the default value in the following cases:
- headers are
null - headers does not contain httpRequestHeader
- httpRequestHeader is no parsable Integer i.e. empty string, non-digit characters, numbers to bigger than Integer allows
- Parameters:
headers- the http request headershttpRequestHeader- the http request header to get the value fromdefaultValue- the default value to return when no value from httpRequestHeader is extractable- Returns:
- an Integer representing the value of the httpRequestHeader or the default value
- headers are
-
getString
public static String getString(io.vertx.core.MultiMap headers, HttpRequestHeader httpRequestHeader)
Get the value of the providedHttpRequestHeaderas String.Returns
nullin the following cases:- headers are
null
- Parameters:
headers- the http request headershttpRequestHeader- the http request header to get the value from- Returns:
- a String representing the value of the httpRequestHeader or null
- headers are
-
-