Class OpenUnsupportedOperationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.core.exception.OpenUnsupportedOperationException
- All Implemented Interfaces:
Serializable
Unsupported Operation Exception - Operation not supported exception
不支持的操作异常 - 操作不支持异常
Thrown when an unsupported operation is called. Replaces UnsupportedOperationException.
当调用不支持的操作时抛出此异常。替代 UnsupportedOperationException,提供统一的异常处理。
Features | 主要功能:
- Immutable object check (immutable) - 不可变对象检查
- Read-only check (readOnly) - 只读检查
- Not implemented check (notImplemented) - 未实现检查
- Unsupported type check (unsupportedType) - 不支持类型检查
- Generic unsupported (unsupported) - 通用不支持检查
Usage Examples | 使用示例:
@Override
public void unsupportedMethod() {
throw new OpenUnsupportedOperationException("This operation is not supported");
}
// Static factory methods - 静态工厂方法
throw OpenUnsupportedOperationException.immutable();
throw OpenUnsupportedOperationException.readOnly();
throw OpenUnsupportedOperationException.notImplemented("save");
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是 (不可变)
- Serializable: Yes - 可序列化: 是
- Since:
- JDK 25, opencode-base-core V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOpenUnsupportedOperationException(String message) Creates 创建不支持操作异常OpenUnsupportedOperationException(String message, Throwable cause) Creates 创建不支持操作异常(带原因) -
Method Summary
Modifier and TypeMethodDescriptionCreates 创建"不可变对象"异常notImplemented(String methodName) Creates 创建"未实现"异常readOnly()Creates 创建"只读"异常unsupported(String operation) Creates 创建"不支持的操作"异常unsupportedType(Class<?> type) Creates 创建"不支持的类型"异常Methods 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
-
OpenUnsupportedOperationException
Creates 创建不支持操作异常- Parameters:
message- the value | 异常消息
-
OpenUnsupportedOperationException
-
-
Method Details
-
immutable
Creates 创建"不可变对象"异常- Returns:
- the result | 异常实例
-
readOnly
Creates 创建"只读"异常- Returns:
- the result | 异常实例
-
notImplemented
Creates 创建"未实现"异常- Parameters:
methodName- the value | 方法名- Returns:
- the result | 异常实例
-
unsupportedType
Creates 创建"不支持的类型"异常- Parameters:
type- the type | 类型- Returns:
- the result | 异常实例
-
unsupported
Creates 创建"不支持的操作"异常- Parameters:
operation- the value | 操作名- Returns:
- the result | 异常实例
-