Record Class AddonMeta
java.lang.Object
java.lang.Record
de.craftsblock.craftsnet.addon.meta.AddonMeta
- Record Components:
name- The name of the addon.mainClass- The main class responsible for initializing the addon.description- The description of the addon.- A list of authors of the addon.website- The website associated with the addon.version- The version of the addon.depends- An array of addon names that must be present and loaded before this.softDepends- An array of addon names that may be present and loaded before this when present.repositories- The maven repositories that should be used while the dependencies are resolved.dependencies- The maven dependencies this addon needs.
public record AddonMeta(String name, String mainClass, String description, List<String> authors, String website, String version, String[] depends, String[] softDepends, String[] repositories, String[] dependencies)
extends Record
Represents metadata information for an addon, such as its name, main class, authors, website, version, and dependencies.
This metadata is typically loaded from a configuration file in JSON format.
- Since:
- 3.1.0-SNAPSHOT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthors()Returns the value of theauthorsrecord component.String[]Returns the value of thedependenciesrecord component.String[]depends()Returns the value of thedependsrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themainClassrecord component.name()Returns the value of thenamerecord component.static AddonMetaof(@NotNull AddonConfiguration configuration) Creates anAddonMetainstance from the configuration provided by theAddonConfiguration.String[]Returns the value of therepositoriesrecord component.String[]Returns the value of thesoftDependsrecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.website()Returns the value of thewebsiterecord component.
-
Constructor Details
-
AddonMeta
public AddonMeta(String name, String mainClass, String description, List<String> authors, String website, String version, String[] depends, String[] softDepends, String[] repositories, String[] dependencies) Creates an instance of aAddonMetarecord class.- Parameters:
name- the value for thenamerecord componentmainClass- the value for themainClassrecord componentdescription- the value for thedescriptionrecord componentauthors- the value for theauthorsrecord componentwebsite- the value for thewebsiterecord componentversion- the value for theversionrecord componentdepends- the value for thedependsrecord componentsoftDepends- the value for thesoftDependsrecord componentrepositories- the value for therepositoriesrecord componentdependencies- the value for thedependenciesrecord component
-
-
Method Details
-
of
Creates anAddonMetainstance from the configuration provided by theAddonConfiguration.- Parameters:
configuration- The configuration object containing the metadata in json format.- Returns:
- A new instance of
AddonMetapopulated with the values from the configuration.
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
mainClass
Returns the value of themainClassrecord component.- Returns:
- the value of the
mainClassrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
authors
Returns the value of theauthorsrecord component.- Returns:
- the value of the
authorsrecord component
-
website
Returns the value of thewebsiterecord component.- Returns:
- the value of the
websiterecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
depends
Returns the value of thedependsrecord component.- Returns:
- the value of the
dependsrecord component
-
softDepends
Returns the value of thesoftDependsrecord component.- Returns:
- the value of the
softDependsrecord component
-
repositories
Returns the value of therepositoriesrecord component.- Returns:
- the value of the
repositoriesrecord component
-
dependencies
Returns the value of thedependenciesrecord component.- Returns:
- the value of the
dependenciesrecord component
-