Record Class AddonInfo
java.lang.Object
java.lang.Record
dev.nozyx.strider.loader.api.AddonInfo
- Record Components:
id- the unique identifier of the addonname- the human-readable name of the addonversion- the version of the addondescription- the description of the addon- the author of the addonside- the Minecraft side targeted by the addonaddonClass- the fully qualified implementation class of the addondependencies- the addon's dependencies and their required versions
public record AddonInfo(String id, String name, String version, String description, String author, MinecraftSide side, String addonClass, Map<String,String> dependencies)
extends Record
Represents the metadata of an addon loaded by StriderLoader.
Contains information such as addon ID, version, description, author, targeted Minecraft side, implementation class and dependencies.
This class is primarily used by addons and the loader to query addon information.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaddonClassrecord component.author()Returns the value of theauthorrecord component.Returns the value of thedependenciesrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.static AddonInfoParses an AddonInfo instance from JSON.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.name()Returns the value of thenamerecord component.side()Returns the value of thesiderecord component.toJson()Serializes this AddonInfo instance to JSON.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
AddonInfo
public AddonInfo(String id, String name, String version, String description, String author, MinecraftSide side, String addonClass, Map<String, String> dependencies) Creates an instance of aAddonInforecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentversion- the value for theversionrecord componentdescription- the value for thedescriptionrecord componentauthor- the value for theauthorrecord componentside- the value for thesiderecord componentaddonClass- the value for theaddonClassrecord componentdependencies- the value for thedependenciesrecord component
-
-
Method Details
-
fromJson
Parses an AddonInfo instance from JSON.- Parameters:
json- the JSON string- Returns:
- the parsed AddonInfo
- Throws:
IllegalArgumentException- if the JSON cannot be parsed
-
toJson
Serializes this AddonInfo instance to JSON.- Returns:
- the JSON representation
- Throws:
IllegalStateException- if serialization fails
-
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
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
author
-
side
-
addonClass
Returns the value of theaddonClassrecord component.- Returns:
- the value of the
addonClassrecord component
-
dependencies
Returns the value of thedependenciesrecord component.- Returns:
- the value of the
dependenciesrecord component
-