Class TreeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.tree.exception.TreeException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CycleDetectedException
Tree Exception
树异常
Base exception for tree operations.
树操作的基础异常。
Features | 主要功能:
- Base exception for tree operations - 树操作的基础异常
- Error code support - 错误码支持
- Factory methods for common errors - 常见错误的工厂方法
Usage Examples | 使用示例:
throw TreeException.duplicateId(nodeId);
throw TreeException.nodeNotFound(nodeId);
throw TreeException.maxDepthExceeded(1000);
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 是(构造后不可变)
- Null-safe: No (message should not be null) - 否(消息不应为null)
- Since:
- JDK 25, opencode-base-tree V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTreeException(TreeErrorCode errorCode) TreeException(TreeErrorCode errorCode, String message) TreeException(TreeErrorCode errorCode, Throwable cause) TreeException(String message) TreeException(String code, String message) TreeException(String message, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionstatic TreeExceptionbuildFailed(String message) static TreeExceptionduplicateId(Object id) getCode()static TreeExceptioninvalidNode(String message) static TreeExceptionmaxDepthExceeded(int maxDepth) static TreeExceptionnodeNotFound(Object id) static TreeExceptionparentNotFound(Object parentId) Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TreeException
-
TreeException
-
TreeException
-
TreeException
-
TreeException
-
TreeException
-
-
Method Details
-
getCode
-
buildFailed
-
invalidNode
-
duplicateId
-
parentNotFound
-
nodeNotFound
-
maxDepthExceeded
-