Record Class PluginContext
java.lang.Object
java.lang.Record
cloud.opencode.base.classloader.plugin.PluginContext
- Record Components:
pluginId- the unique plugin identifier | 唯一的插件标识符descriptor- the plugin descriptor | 插件描述符
Immutable plugin context passed to plugins during lifecycle callbacks
在生命周期回调期间传递给插件的不可变插件上下文
Contains the plugin identity and descriptor information needed by a
Plugin during its Plugin.onStart(PluginContext) callback.
包含 Plugin 在 Plugin.onStart(PluginContext) 回调期间
所需的插件身份和描述符信息。
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
ConstructorsConstructorDescriptionPluginContext(String pluginId, PluginDescriptor descriptor) Create a new PluginContext with null validation 创建带空值校验的新 PluginContext -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.pluginId()Returns the value of thepluginIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PluginContext
Create a new PluginContext with null validation 创建带空值校验的新 PluginContext- Parameters:
pluginId- the unique plugin identifier, must not be null | 唯一的插件标识符,不能为 nulldescriptor- the plugin descriptor, must not be null | 插件描述符,不能为 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). -
pluginId
-
descriptor
Returns the value of thedescriptorrecord component.- Returns:
- the value of the
descriptorrecord component
-