Package org.refcodes.net
Enum HttpSuccessCode
- java.lang.Object
-
- java.lang.Enum<HttpSuccessCode>
-
- org.refcodes.net.HttpSuccessCode
-
- All Implemented Interfaces:
org.refcodes.mixin.StatusCodeAccessor<java.lang.Integer>
public enum HttpSuccessCode extends java.lang.Enum<HttpSuccessCode> implements org.refcodes.mixin.StatusCodeAccessor<java.lang.Integer>
Only the Success 2xx codes as of (from) theHttpStatusCodeenumeration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.StatusCodeAccessor
org.refcodes.mixin.StatusCodeAccessor.StatusCodeBuilder<SC extends java.lang.Object,B extends org.refcodes.mixin.StatusCodeAccessor.StatusCodeBuilder<SC,B>>, org.refcodes.mixin.StatusCodeAccessor.StatusCodeMutator<SC extends java.lang.Object>, org.refcodes.mixin.StatusCodeAccessor.StatusCodeProperty<SC extends java.lang.Object>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCEPTED202 Accepted (HTTP/1.0 - RFC 1945)CREATED201 Created (HTTP/1.0 - RFC 1945)MULTI_STATUS207 Multi-Status (WebDAV - RFC 2518) or 207 Partial Update OK (HTTP/1.1 - draft-ietf-http-v11-spec-rev-01?)NO_CONTENT204 No Content (HTTP/1.0 - RFC 1945)NON_AUTHORITATIVE_INFORMATION203 Non Authoritative Information (HTTP/1.1 - RFC 2616)OK200 OK (HTTP/1.0 - RFC 1945)PARTIAL_CONTENT206 Partial Content (HTTP/1.1 - RFC 2616)RESET_CONTENT205 Reset Content (HTTP/1.1 - RFC 2616)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetStatusCode()static HttpSuccessCodetoHttpSuccessCode(int aHttpStatusCode)Determines the HTTP success code from the given value by evaluating thegetStatusCode()property.static HttpSuccessCodetoHttpSuccessCode(org.refcodes.mixin.StatusCodeAccessor<java.lang.Integer> aHttpStatusCode)Determines the HTTP success code from the given HTTP Status-Code property by evaluating thegetStatusCode()property.static HttpSuccessCodevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static HttpSuccessCode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static HttpSuccessCode[] 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 (HttpSuccessCode c : HttpSuccessCode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpSuccessCode valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getStatusCode
public java.lang.Integer getStatusCode()
- Specified by:
getStatusCodein interfaceorg.refcodes.mixin.StatusCodeAccessor<java.lang.Integer>
-
toHttpSuccessCode
public static HttpSuccessCode toHttpSuccessCode(int aHttpStatusCode)
Determines the HTTP success code from the given value by evaluating thegetStatusCode()property.- Parameters:
aHttpStatusCode- The code from which to get theHttpStatusCodeelement.- Returns:
- The according
HttpStatusCodeelement or null if none was found.
-
toHttpSuccessCode
public static HttpSuccessCode toHttpSuccessCode(org.refcodes.mixin.StatusCodeAccessor<java.lang.Integer> aHttpStatusCode)
Determines the HTTP success code from the given HTTP Status-Code property by evaluating thegetStatusCode()property.- Parameters:
aHttpStatusCode- The code property from whichStatusCodeAccessor.getStatusCode()to get theHttpStatusCodeelement.- Returns:
- The according
HttpStatusCodeelement or null if none was found.
-
-