Enum HttpStatusFamily

java.lang.Object
java.lang.Enum<HttpStatusFamily>
software.amazon.awssdk.http.HttpStatusFamily
All Implemented Interfaces:
Serializable, Comparable<HttpStatusFamily>

public enum HttpStatusFamily extends Enum<HttpStatusFamily>
The set of HTTP status families defined by the standard. A code can be converted to its family with of(int).
  • Enum Constant Details

    • INFORMATIONAL

      public static final HttpStatusFamily INFORMATIONAL
      1xx response family.
    • SUCCESSFUL

      public static final HttpStatusFamily SUCCESSFUL
      2xx response family.
    • REDIRECTION

      public static final HttpStatusFamily REDIRECTION
      3xx response family.
    • CLIENT_ERROR

      public static final HttpStatusFamily CLIENT_ERROR
      4xx response family.
    • SERVER_ERROR

      public static final HttpStatusFamily SERVER_ERROR
      5xx response family.
    • OTHER

      public static final HttpStatusFamily OTHER
      The family for any status code outside of the range 100-599.
  • Method Details

    • values

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

      public static HttpStatusFamily 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
    • of

      public static HttpStatusFamily of(int httpStatusCode)
      Retrieve the HTTP status family for the given HTTP status code.
    • isOneOf

      public boolean isOneOf(HttpStatusFamily... families)
      Determine whether this HTTP status family is in the list of provided families.
      Parameters:
      families - The list of families to check against this family.
      Returns:
      True if any of the families in the list match this one.