Enum Class ImageErrorCode
- All Implemented Interfaces:
Serializable, Comparable<ImageErrorCode>, Constable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCompress failed | 压缩失败Convert failed | 转换失败Crop failed | 裁剪失败File not found | 文件不存在File too large | 文件大小过大Format mismatch | 格式不匹配Image too large | 图片尺寸过大Invalid dimensions | 无效尺寸Invalid image | 无效图片文件Invalid parameters | 无效参数IO error | IO错误Magic number mismatch | 文件魔数不匹配Out of memory | 内存不足Image read failed | 图片读取失败Resize failed | 缩放失败Resource unavailable | 资源不可用Rotate failed | 旋转失败Processing timeout | 处理超时Too many requests | 请求过多Unknown error | 未知错误Unsupported format | 不支持的图片格式Validation failed | 验证失败Watermark failed | 水印失败Image write failed | 图片写入失败 -
Method Summary
Modifier and TypeMethodDescriptionintgetCode()Get error code 获取错误码Get error description 获取错误描述Get error message 获取错误消息static ImageErrorCodeReturns the enum constant of this class with the specified name.static ImageErrorCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
Unknown error | 未知错误 -
READ_FAILED
Image read failed | 图片读取失败 -
WRITE_FAILED
Image write failed | 图片写入失败 -
FILE_NOT_FOUND
File not found | 文件不存在 -
IO_ERROR
IO error | IO错误 -
UNSUPPORTED_FORMAT
Unsupported format | 不支持的图片格式 -
INVALID_IMAGE
Invalid image | 无效图片文件 -
FORMAT_MISMATCH
Format mismatch | 格式不匹配 -
MAGIC_NUMBER_MISMATCH
Magic number mismatch | 文件魔数不匹配 -
RESIZE_FAILED
Resize failed | 缩放失败 -
CROP_FAILED
Crop failed | 裁剪失败 -
ROTATE_FAILED
Rotate failed | 旋转失败 -
WATERMARK_FAILED
Watermark failed | 水印失败 -
COMPRESS_FAILED
Compress failed | 压缩失败 -
INVALID_PARAMETERS
Invalid parameters | 无效参数 -
CONVERT_FAILED
Convert failed | 转换失败 -
IMAGE_TOO_LARGE
Image too large | 图片尺寸过大 -
FILE_TOO_LARGE
File too large | 文件大小过大 -
INVALID_DIMENSIONS
Invalid dimensions | 无效尺寸 -
VALIDATION_FAILED
Validation failed | 验证失败 -
TIMEOUT
Processing timeout | 处理超时 -
OUT_OF_MEMORY
Out of memory | 内存不足 -
TOO_MANY_REQUESTS
Too many requests | 请求过多 -
RESOURCE_UNAVAILABLE
Resource unavailable | 资源不可用
-
-
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
-
getCode
public int getCode()Get error code 获取错误码- Returns:
- the error code | 错误码
-
getMessage
-
getDescription
-