Package com.sap.cds.services
Enum Class ErrorStatuses
- All Implemented Interfaces:
ErrorStatus,Serializable,Comparable<ErrorStatuses>,Constable
This enum implements
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.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorStatusgetByCode(int code) intstatic ErrorStatusesReturns the enum constant of this class with the specified name.static ErrorStatuses[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BAD_REQUEST
-
UNAUTHORIZED
-
FORBIDDEN
-
NOT_FOUND
-
METHOD_NOT_ALLOWED
-
NOT_ACCEPTABLE
-
CONFLICT
-
GONE
-
PRECONDITION_FAILED
-
UNSUPPORTED_MEDIA_TYPE
-
MISDIRECTED_REQUEST
-
UNPROCESSABLE_ENTITY
-
LOCKED
-
PRECONDITION_REQUIRED
-
SERVER_ERROR
-
NOT_IMPLEMENTED
-
BAD_GATEWAY
-
GATEWAY_TIMEOUT
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getDescription
- Specified by:
getDescriptionin interfaceErrorStatus- Returns:
- The error description
-
getHttpStatus
public int getHttpStatus()- Specified by:
getHttpStatusin interfaceErrorStatus- Returns:
- The suggested mapping to a HTTP status code
-
getByCode
- Parameters:
code- the code- Returns:
- the ErrorStatus from this enum, associated with the given code or
null
-
getCodeString
- Specified by:
getCodeStringin interfaceErrorStatus- Returns:
- The internal error code
-