Enum HttpSuccessCode

java.lang.Object
java.lang.Enum<HttpSuccessCode>
org.refcodes.web.HttpSuccessCode
All Implemented Interfaces:
Serializable, Comparable<HttpSuccessCode>, java.lang.constant.Constable, org.refcodes.mixin.StatusCodeAccessor<Integer>

public enum HttpSuccessCode extends Enum<HttpSuccessCode> implements org.refcodes.mixin.StatusCodeAccessor<Integer>
Only the Success 2xx codes as of (from) the HttpStatusCode enumeration.
  • Enum Constant Details

    • OK

      public static final HttpSuccessCode OK
      200 OK (HTTP/1.0 - RFC 1945)
    • CREATED

      public static final HttpSuccessCode CREATED
      201 Created (HTTP/1.0 - RFC 1945)
    • ACCEPTED

      public static final HttpSuccessCode ACCEPTED
      202 Accepted (HTTP/1.0 - RFC 1945)
    • NON_AUTHORITATIVE_INFORMATION

      public static final HttpSuccessCode NON_AUTHORITATIVE_INFORMATION
      203 Non Authoritative Information (HTTP/1.1 - RFC 2616)
    • NO_CONTENT

      public static final HttpSuccessCode NO_CONTENT
      204 No Content (HTTP/1.0 - RFC 1945)
    • RESET_CONTENT

      public static final HttpSuccessCode RESET_CONTENT
      205 Reset Content (HTTP/1.1 - RFC 2616)
    • PARTIAL_CONTENT

      public static final HttpSuccessCode PARTIAL_CONTENT
      206 Partial Content (HTTP/1.1 - RFC 2616)
    • MULTI_STATUS

      public static final HttpSuccessCode MULTI_STATUS
      207 Multi-Status (WebDAV - RFC 2518) or 207 Partial Update OK (HTTP/1.1 - draft-ietf-http-v11-spec-rev-01?)
  • Method Details

    • values

      public static HttpSuccessCode[] 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 HttpSuccessCode 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
    • getStatusCode

      public Integer getStatusCode()
      Specified by:
      getStatusCode in interface org.refcodes.mixin.StatusCodeAccessor<Integer>
    • toHttpSuccessCode

      public static HttpSuccessCode toHttpSuccessCode(int aHttpStatusCode)
      Determines the HTTP success code from the given value by evaluating the getStatusCode() property.
      Parameters:
      aHttpStatusCode - The code from which to get the HttpStatusCode element.
      Returns:
      The according HttpStatusCode element or null if none was found.
    • toHttpSuccessCode

      public static HttpSuccessCode toHttpSuccessCode(org.refcodes.mixin.StatusCodeAccessor<Integer> aHttpStatusCode)
      Determines the HTTP success code from the given HTTP Status-Code property by evaluating the getStatusCode() property.
      Parameters:
      aHttpStatusCode - The code property from which StatusCodeAccessor.getStatusCode() to get the HttpStatusCode element.
      Returns:
      The according HttpStatusCode element or null if none was found.