Class OpenUnsupportedOperationException

All Implemented Interfaces:
Serializable

public class OpenUnsupportedOperationException extends OpenException
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 Details

    • OpenUnsupportedOperationException

      public OpenUnsupportedOperationException(String message)
      Creates 创建不支持操作异常
      Parameters:
      message - the value | 异常消息
    • OpenUnsupportedOperationException

      public OpenUnsupportedOperationException(String message, Throwable cause)
      Creates 创建不支持操作异常(带原因)
      Parameters:
      message - the value | 异常消息
      cause - the value | 原始异常
  • Method Details

    • immutable

      public static OpenUnsupportedOperationException immutable()
      Creates 创建"不可变对象"异常
      Returns:
      the result | 异常实例
    • readOnly

      public static OpenUnsupportedOperationException readOnly()
      Creates 创建"只读"异常
      Returns:
      the result | 异常实例
    • notImplemented

      public static OpenUnsupportedOperationException notImplemented(String methodName)
      Creates 创建"未实现"异常
      Parameters:
      methodName - the value | 方法名
      Returns:
      the result | 异常实例
    • unsupportedType

      public static OpenUnsupportedOperationException unsupportedType(Class<?> type)
      Creates 创建"不支持的类型"异常
      Parameters:
      type - the type | 类型
      Returns:
      the result | 异常实例
    • unsupported

      public static OpenUnsupportedOperationException unsupported(String operation)
      Creates 创建"不支持的操作"异常
      Parameters:
      operation - the value | 操作名
      Returns:
      the result | 异常实例