Record Class PluginMeta
java.lang.Object
java.lang.Record
fr.fidorial.plugin.PluginMeta
- Record Components:
id- the unique identifier of the plugin, also used as its command namespacename- the human-readable nameversion- the versionmain- the fully qualified name of the class implementingPlugin- the authorsdepends- the identifiers of the plugins that must be loaded before this onepermissions- the permissions declared by the plugin, keyed by noderepositories- extra Maven repositories used to resolve the plugin libraries
public record PluginMeta(String id, String name, String version, String main, List<String> authors, List<String> depends, Map<String, PluginMeta.PermissionEntry> permissions, List<String> repositories)
extends Record
The descriptor of a plugin, read from the
fidorial.json file at the root of its jar.
Absent lists and maps are read as empty ones; id, name, version and
main are mandatory.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA permission declared in the descriptor. -
Constructor Summary
ConstructorsConstructorDescriptionPluginMeta(String id, String name, String version, String main, List<String> authors, List<String> depends) Creates a descriptor declaring no permission and no repository.PluginMeta(String id, String name, String version, String main, List<String> authors, List<String> depends, Map<String, PluginMeta.PermissionEntry> permissions) Creates a descriptor declaring no repository.PluginMeta(String id, String name, String version, String main, List<String> authors, List<String> depends, Map<String, PluginMeta.PermissionEntry> permissions, List<String> repositories) Validates the mandatory fields and copies the collections, reading absent ones as empty. -
Method Summary
Modifier and TypeMethodDescriptionauthors()Returns the value of theauthorsrecord component.depends()Returns the value of thedependsrecord component.final 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.main()Returns the value of themainrecord component.name()Returns the value of thenamerecord component.Returns the value of thepermissionsrecord component.Returns the value of therepositoriesrecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
PluginMeta
public PluginMeta(String id, String name, String version, String main, List<String> authors, List<String> depends, Map<String, PluginMeta.PermissionEntry> permissions, List<String> repositories) Validates the mandatory fields and copies the collections, reading absent ones as empty.- Throws:
IllegalArgumentException- ifid,name,versionormainis missing- Since:
- 0.1.0
-
PluginMeta
public PluginMeta(String id, String name, String version, String main, List<String> authors, List<String> depends) Creates a descriptor declaring no permission and no repository.- Parameters:
id- the unique identifier of the pluginname- the human-readable nameversion- the versionmain- the fully qualified name of the class implementingPluginauthors- the authorsdepends- the identifiers of the plugins that must be loaded before this one- Since:
- 0.1.0
-
PluginMeta
public PluginMeta(String id, String name, String version, String main, List<String> authors, List<String> depends, Map<String, PluginMeta.PermissionEntry> permissions) Creates a descriptor declaring no repository.- Parameters:
id- the unique identifier of the pluginname- the human-readable nameversion- the versionmain- the fully qualified name of the class implementingPluginauthors- the authorsdepends- the identifiers of the plugins that must be loaded before this onepermissions- the permissions declared by the plugin, keyed by node- Since:
- 0.1.0
-
-
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
-
main
-
authors
-
depends
-
permissions
Returns the value of thepermissionsrecord component.- Returns:
- the value of the
permissionsrecord component
-
repositories
Returns the value of therepositoriesrecord component.- Returns:
- the value of the
repositoriesrecord component
-