Enum Class ErrorStatuses

java.lang.Object
java.lang.Enum<ErrorStatuses>
com.sap.cds.services.ErrorStatuses
All Implemented Interfaces:
ErrorStatus, Serializable, Comparable<ErrorStatuses>, Constable

public enum ErrorStatuses extends Enum<ErrorStatuses> implements ErrorStatus
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.
  • Enum Constant Details

    • BAD_REQUEST

      public static final ErrorStatuses BAD_REQUEST
    • UNAUTHORIZED

      public static final ErrorStatuses UNAUTHORIZED
    • FORBIDDEN

      public static final ErrorStatuses FORBIDDEN
    • NOT_FOUND

      public static final ErrorStatuses NOT_FOUND
    • METHOD_NOT_ALLOWED

      public static final ErrorStatuses METHOD_NOT_ALLOWED
    • NOT_ACCEPTABLE

      public static final ErrorStatuses NOT_ACCEPTABLE
    • CONFLICT

      public static final ErrorStatuses CONFLICT
    • GONE

      public static final ErrorStatuses GONE
    • PRECONDITION_FAILED

      public static final ErrorStatuses PRECONDITION_FAILED
    • UNSUPPORTED_MEDIA_TYPE

      public static final ErrorStatuses UNSUPPORTED_MEDIA_TYPE
    • MISDIRECTED_REQUEST

      public static final ErrorStatuses MISDIRECTED_REQUEST
    • UNPROCESSABLE_ENTITY

      public static final ErrorStatuses UNPROCESSABLE_ENTITY
    • LOCKED

      public static final ErrorStatuses LOCKED
    • PRECONDITION_REQUIRED

      public static final ErrorStatuses PRECONDITION_REQUIRED
    • SERVER_ERROR

      public static final ErrorStatuses SERVER_ERROR
    • NOT_IMPLEMENTED

      public static final ErrorStatuses NOT_IMPLEMENTED
    • BAD_GATEWAY

      public static final ErrorStatuses BAD_GATEWAY
    • GATEWAY_TIMEOUT

      public static final ErrorStatuses GATEWAY_TIMEOUT
  • Method Details

    • values

      public static ErrorStatuses[] 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

      public static ErrorStatuses valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface ErrorStatus
      Returns:
      The error description
    • getHttpStatus

      public int getHttpStatus()
      Specified by:
      getHttpStatus in interface ErrorStatus
      Returns:
      The suggested mapping to a HTTP status code
    • getByCode

      public static ErrorStatus getByCode(int code)
      Parameters:
      code - the code
      Returns:
      the ErrorStatus from this enum, associated with the given code or null
    • getCodeString

      public String getCodeString()
      Specified by:
      getCodeString in interface ErrorStatus
      Returns:
      The internal error code