Record Class ClassIndex
java.lang.Object
java.lang.Record
cloud.opencode.base.classloader.index.ClassIndex
public record ClassIndex(int version, String timestamp, String classpathHash, List<ClassIndexEntry> entries)
extends Record
Class Index - Immutable record representing a pre-built class index
类索引 - 表示预构建类索引的不可变记录
Contains a versioned, timestamped snapshot of all scanned class metadata along with a classpath hash for staleness detection.
包含所有已扫描类元数据的带版本号和时间戳的快照, 以及用于陈旧检测的 classpath 哈希值。
Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是 (不可变记录)
- Since:
- JDK 25, opencode-base-classloader V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCurrent index format version 当前索引格式版本static final StringDefault classpath location for the index file 索引文件在 classpath 上的默认位置 -
Constructor Summary
ConstructorsConstructorDescriptionClassIndex(int version, String timestamp, String classpathHash, List<ClassIndexEntry> entries) Create a class index with defensive copy of entries 创建类索引,对条目列表进行防御性拷贝 -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclasspathHashrecord component.entries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.intversion()Returns the value of theversionrecord component.
-
Field Details
-
CURRENT_VERSION
public static final int CURRENT_VERSIONCurrent index format version 当前索引格式版本- See Also:
-
INDEX_LOCATION
Default classpath location for the index file 索引文件在 classpath 上的默认位置- See Also:
-
-
Constructor Details
-
ClassIndex
public ClassIndex(int version, String timestamp, String classpathHash, List<ClassIndexEntry> entries) Create a class index with defensive copy of entries 创建类索引,对条目列表进行防御性拷贝- Parameters:
version- index format version | 索引格式版本timestamp- creation timestamp in ISO-8601 format | ISO-8601 格式的创建时间戳classpathHash- SHA-256 hash of the classpath for staleness detection | 用于陈旧检测的 classpath SHA-256 哈希值entries- list of class index entries | 类索引条目列表
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
version
public int version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
classpathHash
Returns the value of theclasspathHashrecord component.- Returns:
- the value of the
classpathHashrecord component
-
entries
Returns the value of theentriesrecord component.- Returns:
- the value of the
entriesrecord component
-