Enum HttpStatusCode

java.lang.Object
java.lang.Enum<HttpStatusCode>
org.apache.olingo.commons.api.http.HttpStatusCode
All Implemented Interfaces:
Serializable, Comparable<HttpStatusCode>, java.lang.constant.Constable

public enum HttpStatusCode extends Enum<HttpStatusCode>
HTTP status codes as defined in RFC 7231, section 6, and additional status codes as defined in RFC 6585
  • Enum Constant Details

  • Method Details

    • values

      public static HttpStatusCode[] 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 HttpStatusCode 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
    • fromStatusCode

      public static HttpStatusCode fromStatusCode(int statusCode)
      Converts a numerical status code into the corresponding status enum object.
      Parameters:
      statusCode - the numerical status code
      Returns:
      the matching status enum object or null if no matching enum is defined
    • getStatusCode

      public int getStatusCode()
      Gets the associated status code.
      Returns:
      the status code.
    • getInfo

      public String getInfo()
      Gets the status code info.
      Returns:
      the status code info
    • toString

      public String toString()
      The status code info is the readable form of the status code.
      Overrides:
      toString in class Enum<HttpStatusCode>