Record Class JarInfo
java.lang.Object
java.lang.Record
cloud.opencode.base.classloader.conflict.JarInfo
- Record Components:
path- the absolute path to the JAR file | JAR 文件的绝对路径version- the version from MANIFEST.MF, or null if not present | MANIFEST.MF 中的版本,不存在则为 nullname- the file name of the JAR | JAR 的文件名
Immutable information about a JAR file
JAR 文件的不可变信息
Captures the path, version, and name of a JAR file for use in conflict detection.
Version is extracted from MANIFEST.MF (Implementation-Version or
Bundle-Version); it may be null if not present.
捕获 JAR 文件的路径、版本和名称,用于冲突检测。版本从 MANIFEST.MF
(Implementation-Version 或 Bundle-Version) 提取;如果不存在则为 null。
Features | 主要功能:
- Immutable record - 不可变记录
- Version extraction from MANIFEST.MF - 从 MANIFEST.MF 提取版本
- Null-safe version field - 版本字段空值安全
Usage Examples | 使用示例:
JarInfo info = new JarInfo(Path.of("/libs/guava-31.jar"), "31.1-jre", "guava-31.jar");
System.out.println(info.name()); // "guava-31.jar"
System.out.println(info.version()); // "31.1-jre"
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是(不可变)
- Since:
- JDK 25, opencode-base-classloader V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.path()Returns the value of thepathrecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
JarInfo
Creates a new JarInfo instance with validation 创建新的 JarInfo 实例并进行验证- Parameters:
path- the absolute path to the JAR file | JAR 文件的绝对路径version- the version from MANIFEST.MF, or null | MANIFEST.MF 中的版本,或 nullname- the file name of the JAR | JAR 的文件名
-
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
path
-
version
-
name
-