Enum HttpRequestHeader

    • 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 name
        NullPointerException - 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 provided HttpRequestHeader as Integer.

        Returns null 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 headers
        httpRequestHeader - the http request header to get the value from
        Returns:
        an Integer representing the value of the httpRequestHeader or null
      • getInteger

        public static Integer getInteger​(io.vertx.core.MultiMap headers,
                                         HttpRequestHeader httpRequestHeader,
                                         Integer defaultValue)
        Get the value of the provided HttpRequestHeader or 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 headers
        httpRequestHeader - the http request header to get the value from
        defaultValue - 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
      • getString

        public static String getString​(io.vertx.core.MultiMap headers,
                                       HttpRequestHeader httpRequestHeader)
        Get the value of the provided HttpRequestHeader as String.

        Returns null in the following cases:

        • headers are null
        Parameters:
        headers - the http request headers
        httpRequestHeader - the http request header to get the value from
        Returns:
        a String representing the value of the httpRequestHeader or null