Enum Class EHttpVersion

java.lang.Object
java.lang.Enum<EHttpVersion>
com.helger.http.EHttpVersion
All Implemented Interfaces:
com.helger.base.name.IHasName, Serializable, Comparable<EHttpVersion>, Constable

public enum EHttpVersion extends Enum<EHttpVersion> implements com.helger.base.name.IHasName
HTTP versions as defined in RFC 9112 (HTTP/1.1), RFC 9113 (HTTP/2) and RFC 9114 (HTTP/3).
Author:
Philip Helger
  • Enum Constant Details

    • HTTP_10

      public static final EHttpVersion HTTP_10
    • HTTP_11

      public static final EHttpVersion HTTP_11
    • HTTP_20

      public static final EHttpVersion HTTP_20
    • HTTP_30

      public static final EHttpVersion HTTP_30
      HTTP/3 as defined in RFC 9114. @since 12.1.5
  • Method Details

    • values

      public static EHttpVersion[] 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 EHttpVersion 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
    • getName

      @Nonempty public @NonNull @Nonempty String getName()
      Specified by:
      getName in interface com.helger.base.name.IHasName
    • is10

      public boolean is10()
      Returns:
      true if this is HTTP/1.0, false otherwise.
    • isAtLeast11

      public boolean isAtLeast11()
      Returns:
      true if this is HTTP/1.1 or later, false otherwise.
    • getFromNameOrNull

      public static @Nullable EHttpVersion getFromNameOrNull(@Nullable String sName)
      Get the enum value matching the provided name.
      Parameters:
      sName - The name to search. May be null.
      Returns:
      null if no matching enum value was found.