Record Class PluginDescriptor<T extends Plugin>
- Type Parameters:
T- the base plugin contract type under which this plugin was resolved- Record Components:
sourceLocation- the source location from which the plugin was loaded, such as a JAR file or exploded classpath directoryidentity- the logical plugin identity reported by the plugin instance; intended for distinguishing plugins at runtimepluginClass- the concrete implementation class of the pluginkindClass- the resolved base plugin contract implemented by the plugincontracts- all resolved plugin contracts implemented by the plugin, mapped to their declared API levelsrequiredProviders- all resolved core providers required by the plugin, mapped to their required API levels
This descriptor represents a plugin after metadata has been interpreted in the context of the
running application and the relevant Java types have been resolved. Unlike the build-time or
serialized descriptor form, this model uses actual Class references for the plugin
implementation, its base contract, all implemented plugin contracts, and all required core
providers.
The generic type parameter T represents the base plugin contract under which the plugin
was resolved and loaded. The pluginClass is therefore guaranteed to implement that base
contract, while kindClass denotes the concrete base plugin contract itself.
The contracts map contains all plugin contracts implemented by the plugin together with
their declared API levels. This includes the base contract as well as any optional capability
contracts. The requiredProviders map contains all core providers required by the plugin's
implemented contracts, again paired with their declared API levels.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontractLevel(Class<? extends Plugin> contractClass) Returns the value of thecontractsrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.identity()Returns the value of theidentityrecord component.booleanimplementsContract(Class<? extends Plugin> contractClass) Returns the value of thekindClassrecord component.Returns the normalized identity string of this plugin.Returns the value of thepluginClassrecord component.requiredProviderLevel(Class<? extends CoreProvider> providerClass) Map<Class<? extends CoreProvider>,Integer> Returns the value of therequiredProvidersrecord component.booleanrequiresProvider(Class<? extends CoreProvider> providerClass) Returns the value of thesourceLocationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PluginDescriptor
public PluginDescriptor(Path sourceLocation, String identity, Class<? extends T> pluginClass, Class<T> kindClass, Map<Class<? extends Plugin>, Integer> contracts, Map<Class<? extends CoreProvider>, Integer> requiredProviders) Creates an instance of aPluginDescriptorrecord class.- Parameters:
sourceLocation- the value for thesourceLocationrecord componentidentity- the value for theidentityrecord componentpluginClass- the value for thepluginClassrecord componentkindClass- the value for thekindClassrecord componentcontracts- the value for thecontractsrecord componentrequiredProviders- the value for therequiredProvidersrecord component
-
-
Method Details
-
implementsContract
-
contractLevel
-
requiresProvider
-
requiredProviderLevel
-
normalizedIdentity
Returns the normalized identity string of this plugin. The normalization process converts the identity to lowercase and removes special characters such as "/\\-_:.#~*", ensuring a consistent format for comparison purposes.- Returns:
- the normalized identity string, or null if the original identity is null
-
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
sourceLocation
Returns the value of thesourceLocationrecord component.- Returns:
- the value of the
sourceLocationrecord component
-
identity
Returns the value of theidentityrecord component.- Returns:
- the value of the
identityrecord component
-
pluginClass
Returns the value of thepluginClassrecord component.- Returns:
- the value of the
pluginClassrecord component
-
kindClass
Returns the value of thekindClassrecord component.- Returns:
- the value of the
kindClassrecord component
-
contracts
Returns the value of thecontractsrecord component.- Returns:
- the value of the
contractsrecord component
-
requiredProviders
Returns the value of therequiredProvidersrecord component.- Returns:
- the value of the
requiredProvidersrecord component
-