Interface ApiErrorCode

All Known Implementing Classes:
BadRequestApiErrorCode, ConflictApiErrorCode, ForbiddenApiErrorCode, InternalServerErrorApiErrorCode, MethodNotAllowedApiErrorCode, NotFoundApiErrorCode, ServiceUnavailableApiErrorCode, TooManyRequestsApiErrorCode, UnauthorizedApiErrorCode, UnprocessableEntityApiErrorCode

public interface ApiErrorCode
Common interface for all API error code enums.

Each HTTP status code has its own enum implementing this interface:

Use this interface when you need to handle error codes generically, or use the specific enum class for type-safe handling of status-specific codes.

  • Method Summary

    Modifier and Type
    Method
    Description
    Get the string value of this error code as returned by the API.
    boolean
    Check if this error code is a known (non-unknown) value.
    Get the enum name (e.g., "DUPLICATE_ENTRY", "PAYMENT_PROCESSING_FAILED").
  • Method Details

    • getValue

      String getValue()
      Get the string value of this error code as returned by the API.
      Returns:
      the API string value, or null for unknown codes
    • isKnown

      boolean isKnown()
      Check if this error code is a known (non-unknown) value.
      Returns:
      true if this is a recognized error code
    • name

      String name()
      Get the enum name (e.g., "DUPLICATE_ENTRY", "PAYMENT_PROCESSING_FAILED").
      Returns:
      the enum constant name