Record Class PluginDescriptor
java.lang.Object
java.lang.Record
cloud.opencode.base.classloader.plugin.PluginDescriptor
- Record Components:
id- the unique plugin identifier | 唯一的插件标识符name- the human-readable plugin name | 人类可读的插件名称version- the plugin version string | 插件版本字符串mainClass- the fully qualified name of thePluginimplementation |Plugin实现的完全限定类名jarPath- the path to the plugin JAR file | 插件 JAR 文件的路径
public record PluginDescriptor(String id, String name, String version, String mainClass, Path jarPath)
extends Record
Immutable plugin descriptor loaded from META-INF/opencode/plugin.properties
从 META-INF/opencode/plugin.properties 加载的不可变插件描述符
Contains all metadata needed to identify and load a plugin: id, name, version, main class, and JAR path.
包含标识和加载插件所需的所有元数据: ID、名称、版本、主类和 JAR 路径。
Properties format | 属性文件格式:
plugin.id=auth-plugin plugin.name=Authentication Plugin plugin.version=1.0.0 plugin.mainClass=com.example.AuthPlugin
Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是 (不可变 record)
- Null-safe: Yes (constructor validates) - 空值安全: 是 (构造器校验)
- 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.id()Returns the value of theidrecord component.jarPath()Returns the value of thejarPathrecord component.Returns the value of themainClassrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
PluginDescriptor
Create a new PluginDescriptor with null validation 创建带空值校验的新 PluginDescriptor- Parameters:
id- the unique plugin identifier, must not be null | 唯一的插件标识符,不能为 nullname- the human-readable plugin name, must not be null | 人类可读的插件名称,不能为 nullversion- the plugin version string, must not be null | 插件版本字符串,不能为 nullmainClass- the fully qualified plugin main class, must not be null | 完全限定的插件主类名,不能为 nulljarPath- the path to the plugin JAR, must not be null | 插件 JAR 的路径,不能为 null- Throws:
NullPointerException- if any parameter is null | 当任何参数为 null 时
-
-
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). -
id
-
name
-
version
-
mainClass
-
jarPath
-