Enum HttpStatusFamily

    • Enum Constant Detail

      • 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 Detail

      • values

        public static HttpStatusFamily[] 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 (HttpStatusFamily c : HttpStatusFamily.values())
            System.out.println(c);
        
        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.