Enum Class HttpVersion

java.lang.Object
java.lang.Enum<HttpVersion>
io.inverno.mod.http.base.HttpVersion
All Implemented Interfaces:
Serializable, Comparable<HttpVersion>, Constable

public enum HttpVersion extends Enum<HttpVersion>

Represents HTTP protocol versions.

Since:
1.6
Author:
Jeremy Kuhn
  • Enum Constant Details

    • HTTP

      public static final HttpVersion HTTP
      HTTP protocol with undefined version.
    • HTTP_1_0

      public static final HttpVersion HTTP_1_0
      HTTP/1.0 protocol as defined by RFC 1945
    • HTTP_1_1

      public static final HttpVersion HTTP_1_1
      HTTP/1.1 protocol as defined by RFC 7230
    • HTTP_2_0

      public static final HttpVersion HTTP_2_0
      HTTP/2.0 protocol as defined by RFC 7540
  • Method Details

    • values

      public static HttpVersion[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HttpVersion valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getMajor

      public int getMajor()

      Returns protocol's major version.

      Returns:
      the major version
    • getMinor

      public int getMinor()

      Returns protocol's minor version.

      Returns:
      the minor version
    • getCode

      public String getCode()

      Returns protocol's code.

      Returns:
      the code
    • isAlpn

      public boolean isAlpn()

      Determines whether the protocol is supported by ALPN as specified by RFC 7301

      Returns:
      true if the protocol is supportd by ALPN, false otherwise