Enum Class ImageErrorCode

java.lang.Object
java.lang.Enum<ImageErrorCode>
cloud.opencode.base.image.exception.ImageErrorCode
All Implemented Interfaces:
Serializable, Comparable<ImageErrorCode>, Constable

public enum ImageErrorCode extends Enum<ImageErrorCode>
Image Error Code 图片错误码枚举

Error codes for image processing operations.

图片处理操作的错误码。

Error Code Ranges | 错误码范围:

  • 1xxx - IO errors | IO错误
  • 2xxx - Format errors | 格式错误
  • 3xxx - Operation errors | 操作错误
  • 4xxx - Validation errors | 验证错误
  • 5xxx - Resource errors | 资源错误

Features | 主要功能:

  • Enumeration of image processing error codes - 图片处理错误码枚举
  • Categorized by type: IO, format, operation, validation, resource - 按类型分类:IO、格式、操作、验证、资源
  • Bilingual error messages (English + Chinese) - 双语错误消息(英文 + 中文)

Usage Examples | 使用示例:

// Use error code in exception
throw new ImageException("Read failed", ImageErrorCode.READ_FAILED);

// Get error info
int code = ImageErrorCode.READ_FAILED.getCode();
String msg = ImageErrorCode.READ_FAILED.getMessage();

Security | 安全性:

  • Thread-safe: Yes (immutable enum) - 线程安全: 是(不可变枚举)
  • Null-safe: N/A - 空值安全: 不适用
Since:
JDK 25, opencode-base-image V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • UNKNOWN

      public static final ImageErrorCode UNKNOWN
      Unknown error | 未知错误
    • READ_FAILED

      public static final ImageErrorCode READ_FAILED
      Image read failed | 图片读取失败
    • WRITE_FAILED

      public static final ImageErrorCode WRITE_FAILED
      Image write failed | 图片写入失败
    • FILE_NOT_FOUND

      public static final ImageErrorCode FILE_NOT_FOUND
      File not found | 文件不存在
    • IO_ERROR

      public static final ImageErrorCode IO_ERROR
      IO error | IO错误
    • UNSUPPORTED_FORMAT

      public static final ImageErrorCode UNSUPPORTED_FORMAT
      Unsupported format | 不支持的图片格式
    • INVALID_IMAGE

      public static final ImageErrorCode INVALID_IMAGE
      Invalid image | 无效图片文件
    • FORMAT_MISMATCH

      public static final ImageErrorCode FORMAT_MISMATCH
      Format mismatch | 格式不匹配
    • MAGIC_NUMBER_MISMATCH

      public static final ImageErrorCode MAGIC_NUMBER_MISMATCH
      Magic number mismatch | 文件魔数不匹配
    • RESIZE_FAILED

      public static final ImageErrorCode RESIZE_FAILED
      Resize failed | 缩放失败
    • CROP_FAILED

      public static final ImageErrorCode CROP_FAILED
      Crop failed | 裁剪失败
    • ROTATE_FAILED

      public static final ImageErrorCode ROTATE_FAILED
      Rotate failed | 旋转失败
    • WATERMARK_FAILED

      public static final ImageErrorCode WATERMARK_FAILED
      Watermark failed | 水印失败
    • COMPRESS_FAILED

      public static final ImageErrorCode COMPRESS_FAILED
      Compress failed | 压缩失败
    • INVALID_PARAMETERS

      public static final ImageErrorCode INVALID_PARAMETERS
      Invalid parameters | 无效参数
    • CONVERT_FAILED

      public static final ImageErrorCode CONVERT_FAILED
      Convert failed | 转换失败
    • IMAGE_TOO_LARGE

      public static final ImageErrorCode IMAGE_TOO_LARGE
      Image too large | 图片尺寸过大
    • FILE_TOO_LARGE

      public static final ImageErrorCode FILE_TOO_LARGE
      File too large | 文件大小过大
    • INVALID_DIMENSIONS

      public static final ImageErrorCode INVALID_DIMENSIONS
      Invalid dimensions | 无效尺寸
    • VALIDATION_FAILED

      public static final ImageErrorCode VALIDATION_FAILED
      Validation failed | 验证失败
    • TIMEOUT

      public static final ImageErrorCode TIMEOUT
      Processing timeout | 处理超时
    • OUT_OF_MEMORY

      public static final ImageErrorCode OUT_OF_MEMORY
      Out of memory | 内存不足
    • TOO_MANY_REQUESTS

      public static final ImageErrorCode TOO_MANY_REQUESTS
      Too many requests | 请求过多
    • RESOURCE_UNAVAILABLE

      public static final ImageErrorCode RESOURCE_UNAVAILABLE
      Resource unavailable | 资源不可用
    • KERNEL_ERROR

      public static final ImageErrorCode KERNEL_ERROR
      Kernel operation failed | 像素内核操作失败
    • FILTER_ERROR

      public static final ImageErrorCode FILTER_ERROR
      Filter operation failed | 滤波操作失败
    • EDGE_DETECTION_ERROR

      public static final ImageErrorCode EDGE_DETECTION_ERROR
      Edge detection failed | 边缘检测失败
    • MORPHOLOGY_ERROR

      public static final ImageErrorCode MORPHOLOGY_ERROR
      Morphology operation failed | 形态学操作失败
    • THRESHOLD_ERROR

      public static final ImageErrorCode THRESHOLD_ERROR
      Threshold operation failed | 二值化操作失败
    • HISTOGRAM_ERROR

      public static final ImageErrorCode HISTOGRAM_ERROR
      Histogram operation failed | 直方图操作失败
    • COLOR_SPACE_ERROR

      public static final ImageErrorCode COLOR_SPACE_ERROR
      Color space conversion failed | 颜色空间转换失败
    • EXIF_PARSE_ERROR

      public static final ImageErrorCode EXIF_PARSE_ERROR
      EXIF parsing failed | EXIF 解析失败
    • COMPARE_ERROR

      public static final ImageErrorCode COMPARE_ERROR
      Image comparison failed | 图像比较失败
  • Method Details

    • values

      public static ImageErrorCode[] 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 ImageErrorCode 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
    • getCode

      public int getCode()
      Get error code 获取错误码
      Returns:
      the error code | 错误码
    • getMessage

      public String getMessage()
      Get error message 获取错误消息
      Returns:
      the error message | 错误消息
    • getDescription

      public String getDescription()
      Get error description 获取错误描述
      Returns:
      the error description | 错误描述