Enum Class GraphErrorCode

java.lang.Object
java.lang.Enum<GraphErrorCode>
cloud.opencode.base.graph.exception.GraphErrorCode
All Implemented Interfaces:
Serializable, Comparable<GraphErrorCode>, Constable

public enum GraphErrorCode extends Enum<GraphErrorCode>
Graph Error Code 图错误码

Error codes for graph operations.

图操作的错误码。

Features | 主要功能:

  • Categorized error codes (1xxx structure, 2xxx algorithm, 3xxx validation, 4xxx resource) - 分类错误码
  • Numeric code and description for each error - 每个错误的数字代码和描述

Usage Examples | 使用示例:

GraphErrorCode code = GraphErrorCode.CYCLE_DETECTED;
int numericCode = code.getCode();          // 2001
String desc = code.getDescription();       // "Cycle detected"

Security | 安全性:

  • Thread-safe: Yes (immutable enum) - 线程安全: 是(不可变枚举)
  • Null-safe: Yes - 空值安全: 是
Since:
JDK 25, opencode-base-graph V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • UNKNOWN

      public static final GraphErrorCode UNKNOWN
      Unknown error | 未知错误
    • VERTEX_NOT_FOUND

      public static final GraphErrorCode VERTEX_NOT_FOUND
      Vertex not found | 顶点不存在
    • EDGE_NOT_FOUND

      public static final GraphErrorCode EDGE_NOT_FOUND
      Edge not found | 边不存在
    • DUPLICATE_VERTEX

      public static final GraphErrorCode DUPLICATE_VERTEX
      Duplicate vertex | 重复顶点
    • DUPLICATE_EDGE

      public static final GraphErrorCode DUPLICATE_EDGE
      Duplicate edge | 重复边
    • CYCLE_DETECTED

      public static final GraphErrorCode CYCLE_DETECTED
      Cycle detected | 检测到环
    • NO_PATH

      public static final GraphErrorCode NO_PATH
      No path exists | 无路径
    • DISCONNECTED

      public static final GraphErrorCode DISCONNECTED
      Graph is disconnected | 图不连通
    • NEGATIVE_WEIGHT

      public static final GraphErrorCode NEGATIVE_WEIGHT
      Negative weight edge | 负权边
    • INVALID_DIRECTION

      public static final GraphErrorCode INVALID_DIRECTION
      Invalid graph direction | 无效的图方向
    • NEGATIVE_CYCLE

      public static final GraphErrorCode NEGATIVE_CYCLE
      Negative weight cycle detected | 检测到负权环
    • NOT_DAG

      public static final GraphErrorCode NOT_DAG
      Graph is not a DAG | 图不是有向无环图
    • NOT_BIPARTITE

      public static final GraphErrorCode NOT_BIPARTITE
      Graph is not bipartite | 图不是二部图
    • INVALID_VERTEX

      public static final GraphErrorCode INVALID_VERTEX
      Invalid vertex | 无效顶点
    • INVALID_EDGE

      public static final GraphErrorCode INVALID_EDGE
      Invalid edge | 无效边
    • INVALID_WEIGHT

      public static final GraphErrorCode INVALID_WEIGHT
      Invalid weight | 无效权重
    • LIMIT_EXCEEDED

      public static final GraphErrorCode LIMIT_EXCEEDED
      Limit exceeded | 超出限制
    • TIMEOUT

      public static final GraphErrorCode TIMEOUT
      Timeout | 计算超时
    • OUT_OF_MEMORY

      public static final GraphErrorCode OUT_OF_MEMORY
      Out of memory | 内存不足
  • Method Details

    • values

      public static GraphErrorCode[] 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

      public static GraphErrorCode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Get the error code 获取错误码
      Returns:
      error code | 错误码
    • getDescription

      public String getDescription()
      Get the error description 获取错误描述
      Returns:
      error description | 错误描述