Class DataGenerationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.test.exception.TestException
cloud.opencode.base.test.exception.DataGenerationException
- All Implemented Interfaces:
Serializable
Data Generation Exception - Exception thrown during test data generation
数据生成异常 - 测试数据生成期间抛出的异常
This exception is thrown when test data generation fails.
当测试数据生成失败时抛出此异常。
Features | 主要功能:
- Data generation failure reporting - 数据生成失败报告
- Invalid range error reporting - 无效范围错误报告
- Factory methods for common generation errors - 常见生成错误的工厂方法
Usage Examples | 使用示例:
throw DataGenerationException.generationFailed("email");
throw DataGenerationException.invalidRange(100, 10);
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
- Null-safe: Yes - 空值安全: 是
- Since:
- JDK 25, opencode-base-test V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDataGenerationException(TestErrorCode errorCode) Creates data generation exception with error code.DataGenerationException(TestErrorCode errorCode, String detail) Creates data generation exception with error code and detail.DataGenerationException(String message) Creates data generation exception with message.DataGenerationException(String message, Throwable cause) Creates data generation exception with message and cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataGenerationExceptiongenerationFailed(String dataType) Creates exception for general generation failure.static DataGenerationExceptioninvalidRange(Number min, Number max) Creates exception for invalid range.Methods inherited from class TestException
getTestErrorCodeMethods inherited from class OpenException
getComponent, getErrorCode, getMessage, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DataGenerationException
Creates data generation exception with error code. 使用错误码创建数据生成异常。- Parameters:
errorCode- the error code | 错误码
-
DataGenerationException
Creates data generation exception with error code and detail. 使用错误码和详情创建数据生成异常。- Parameters:
errorCode- the error code | 错误码detail- the detail message | 详细消息
-
DataGenerationException
Creates data generation exception with message. 使用消息创建数据生成异常。- Parameters:
message- the message | 消息
-
DataGenerationException
-
-
Method Details
-
generationFailed
Creates exception for general generation failure. 为一般生成失败创建异常。- Parameters:
dataType- the type of data | 数据类型- Returns:
- the exception | 异常
-
invalidRange
Creates exception for invalid range. 为无效范围创建异常。- Parameters:
min- the minimum value | 最小值max- the maximum value | 最大值- Returns:
- the exception | 异常
-