Package org.swisspush.gateleen.core.util
Enum StatusCode
- java.lang.Object
-
- java.lang.Enum<StatusCode>
-
- org.swisspush.gateleen.core.util.StatusCode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<StatusCode>
public enum StatusCode extends java.lang.Enum<StatusCode>
Enum for HTTP status codes- Author:
- https://github.com/mcweba [Marc-Andre Weber]
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCEPTEDBAD_GATEWAYBAD_REQUESTCONFLICTFORBIDDENINSUFFICIENT_STORAGEINTERNAL_SERVER_ERRORMETHOD_NOT_ALLOWEDNOT_FOUNDNOT_MODIFIEDOKSERVICE_UNAVAILABLETIMEOUTUNSUPPORTED_MEDIA_TYPE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StatusCodefromCode(int code)Returns the enum StatusCode which matches the specified http status code.intgetStatusCode()java.lang.StringgetStatusMessage()java.lang.StringtoString()static StatusCodevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static StatusCode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
OK
public static final StatusCode OK
-
ACCEPTED
public static final StatusCode ACCEPTED
-
NOT_MODIFIED
public static final StatusCode NOT_MODIFIED
-
BAD_REQUEST
public static final StatusCode BAD_REQUEST
-
FORBIDDEN
public static final StatusCode FORBIDDEN
-
NOT_FOUND
public static final StatusCode NOT_FOUND
-
METHOD_NOT_ALLOWED
public static final StatusCode METHOD_NOT_ALLOWED
-
CONFLICT
public static final StatusCode CONFLICT
-
UNSUPPORTED_MEDIA_TYPE
public static final StatusCode UNSUPPORTED_MEDIA_TYPE
-
INTERNAL_SERVER_ERROR
public static final StatusCode INTERNAL_SERVER_ERROR
-
BAD_GATEWAY
public static final StatusCode BAD_GATEWAY
-
SERVICE_UNAVAILABLE
public static final StatusCode SERVICE_UNAVAILABLE
-
TIMEOUT
public static final StatusCode TIMEOUT
-
INSUFFICIENT_STORAGE
public static final StatusCode INSUFFICIENT_STORAGE
-
-
Method Detail
-
values
public static StatusCode[] 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 (StatusCode c : StatusCode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StatusCode 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 int getStatusCode()
-
getStatusMessage
public java.lang.String getStatusMessage()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<StatusCode>
-
fromCode
public static StatusCode fromCode(int code)
Returns the enum StatusCode which matches the specified http status code.- Parameters:
code- code- Returns:
- The matching StatusCode or null if none matches.
-
-