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.
authors - 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 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 a AddonMeta record class.
      Parameters:
      name - the value for the name record component
      mainClass - the value for the mainClass record component
      description - the value for the description record component
      authors - the value for the authors record component
      website - the value for the website record component
      version - the value for the version record component
      depends - the value for the depends record component
      softDepends - the value for the softDepends record component
      repositories - the value for the repositories record component
      dependencies - the value for the dependencies record component
  • Method Details

    • of

      public static AddonMeta of(@NotNull @NotNull AddonConfiguration configuration)
      Creates an AddonMeta instance from the configuration provided by the AddonConfiguration.
      Parameters:
      configuration - The configuration object containing the metadata in json format.
      Returns:
      A new instance of AddonMeta populated with the values from the configuration.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • mainClass

      public String mainClass()
      Returns the value of the mainClass record component.
      Returns:
      the value of the mainClass record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • authors

      public List<String> authors()
      Returns the value of the authors record component.
      Returns:
      the value of the authors record component
    • website

      public String website()
      Returns the value of the website record component.
      Returns:
      the value of the website record component
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • depends

      public String[] depends()
      Returns the value of the depends record component.
      Returns:
      the value of the depends record component
    • softDepends

      public String[] softDepends()
      Returns the value of the softDepends record component.
      Returns:
      the value of the softDepends record component
    • repositories

      public String[] repositories()
      Returns the value of the repositories record component.
      Returns:
      the value of the repositories record component
    • dependencies

      public String[] dependencies()
      Returns the value of the dependencies record component.
      Returns:
      the value of the dependencies record component