Package io.gdcc.spi.core.loader
Record Class PluginHandle<T extends Plugin>
java.lang.Object
java.lang.Record
io.gdcc.spi.core.loader.PluginHandle<T>
- Type Parameters:
T- the type of the plugin instance, which must extendPlugin- Record Components:
descriptor- the runtime descriptor containing metadata and implementation details about the plugin; must not be nullplugin- the actual plugin instance associated with the descriptor; must not be null
public record PluginHandle<T extends Plugin>(PluginDescriptor<T extends Plugin> descriptor, T extends Plugin plugin)
extends Record
Encapsulates a plugin and its corresponding descriptor, providing a unified representation
of a resolved plugin and its metadata in the runtime context.
The PluginHandle is an immutable record that binds a concrete plugin instance
with its associated PluginDescriptor. This ensures both the metadata and the
operational plugin instance are accessible and linked together, facilitating plugin management
and execution.
-
Constructor Summary
ConstructorsConstructorDescriptionPluginHandle(PluginDescriptor<T> descriptor, T plugin) Creates an instance of aPluginHandlerecord class. -
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.plugin()Returns the value of thepluginrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PluginHandle
Creates an instance of aPluginHandlerecord class.- Parameters:
descriptor- the value for thedescriptorrecord componentplugin- the value for thepluginrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
descriptor
Returns the value of thedescriptorrecord component.- Returns:
- the value of the
descriptorrecord component
-
plugin
Returns the value of thepluginrecord component.- Returns:
- the value of the
pluginrecord component
-