public enum ErrorStatuses extends Enum<ErrorStatuses> implements ErrorStatus
ErrorStatus
, which is the interface required by
ServiceException
. It provides a default set of ErrorStatus
constants.
Additional ErrorStatus
can be defined, by either implementing
classes, which implement ErrorStatus
or by defining an additional
enum, which again implements the interface and defines further constants.Enum Constant and Description |
---|
BAD_GATEWAY |
BAD_REQUEST |
CONFLICT |
FORBIDDEN |
GATEWAY_TIMEOUT |
GONE |
LOCKED |
METHOD_NOT_ALLOWED |
MISDIRECTED_REQUEST |
NOT_ACCEPTABLE |
NOT_FOUND |
NOT_IMPLEMENTED |
PRECONDITION_FAILED |
PRECONDITION_REQUIRED |
SERVER_ERROR |
UNAUTHORIZED |
UNPROCESSABLE_ENTITY |
UNSUPPORTED_MEDIA_TYPE |
Modifier and Type | Method and Description |
---|---|
static ErrorStatus |
getByCode(int code) |
int |
getCode() |
String |
getDescription() |
int |
getHttpStatus() |
static ErrorStatuses |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ErrorStatuses[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getCodeString
public static final ErrorStatuses BAD_REQUEST
public static final ErrorStatuses UNAUTHORIZED
public static final ErrorStatuses FORBIDDEN
public static final ErrorStatuses NOT_FOUND
public static final ErrorStatuses METHOD_NOT_ALLOWED
public static final ErrorStatuses NOT_ACCEPTABLE
public static final ErrorStatuses CONFLICT
public static final ErrorStatuses GONE
public static final ErrorStatuses PRECONDITION_FAILED
public static final ErrorStatuses UNSUPPORTED_MEDIA_TYPE
public static final ErrorStatuses MISDIRECTED_REQUEST
public static final ErrorStatuses UNPROCESSABLE_ENTITY
public static final ErrorStatuses LOCKED
public static final ErrorStatuses PRECONDITION_REQUIRED
public static final ErrorStatuses SERVER_ERROR
public static final ErrorStatuses NOT_IMPLEMENTED
public static final ErrorStatuses BAD_GATEWAY
public static final ErrorStatuses GATEWAY_TIMEOUT
public static ErrorStatuses[] values()
for (ErrorStatuses c : ErrorStatuses.values()) System.out.println(c);
public static ErrorStatuses valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getCode()
getCode
in interface ErrorStatus
public String getDescription()
getDescription
in interface ErrorStatus
public int getHttpStatus()
getHttpStatus
in interface ErrorStatus
public static ErrorStatus getByCode(int code)
code
- the codenull
Copyright © 2023. All rights reserved.