Module methanol

Class HttpStatus

java.lang.Object
com.github.mizosoft.methanol.HttpStatus

public class HttpStatus extends Object
Static functions for checking response status codes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isClientError(int statusCode)
    Returns true if statusCode is a 4xx client error status code.
    static boolean
    Returns true if response.statusCode() is a 4xx client error status code.
    static boolean
    isInformational(int statusCode)
    Returns true if statusCode is a 1xx informational status code.
    static boolean
    Returns true if response.statusCode() is a 1xx informational status code.
    static boolean
    isRedirection(int statusCode)
    Returns true if statusCode is a 3xx redirection status code.
    static boolean
    Returns true if response.statusCode() is a 3xx redirection status code.
    static boolean
    isServerError(int statusCode)
    Returns true if statusCode is a 5xx server error status code.
    static boolean
    Returns true if response.statusCode() is a 5xx server error status code.
    static boolean
    isSuccessful(int statusCode)
    Returns true if statusCode is a 2xx success status code.
    static boolean
    Returns true if response.statusCode() is a 2xx successful status code.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isInformational

      public static boolean isInformational(int statusCode)
      Returns true if statusCode is a 1xx informational status code.
    • isInformational

      public static boolean isInformational(HttpResponse<?> response)
      Returns true if response.statusCode() is a 1xx informational status code.
    • isSuccessful

      public static boolean isSuccessful(int statusCode)
      Returns true if statusCode is a 2xx success status code.
    • isSuccessful

      public static boolean isSuccessful(HttpResponse<?> response)
      Returns true if response.statusCode() is a 2xx successful status code.
    • isRedirection

      public static boolean isRedirection(int statusCode)
      Returns true if statusCode is a 3xx redirection status code.
    • isRedirection

      public static boolean isRedirection(HttpResponse<?> response)
      Returns true if response.statusCode() is a 3xx redirection status code.
    • isClientError

      public static boolean isClientError(int statusCode)
      Returns true if statusCode is a 4xx client error status code.
    • isClientError

      public static boolean isClientError(HttpResponse<?> response)
      Returns true if response.statusCode() is a 4xx client error status code.
    • isServerError

      public static boolean isServerError(int statusCode)
      Returns true if statusCode is a 5xx server error status code.
    • isServerError

      public static boolean isServerError(HttpResponse<?> response)
      Returns true if response.statusCode() is a 5xx server error status code.