Package io.github.smootheez.modrinth
Record Class DependencyMetadata
java.lang.Object
java.lang.Record
io.github.smootheez.modrinth.DependencyMetadata
- Record Components:
projectId- The unique identifier or slug of the dependent project, as recognized by the remote platform. Annotated withproject_idfor correct JSON mapping.dependencyType- The relationship type between this project and the dependency, defining whether it is required, optional, incompatible, or has other semantics. Annotated withdependency_typefor JSON mapping.
Represents a single dependency entry used when publishing metadata
to external mod distribution platforms such as CurseForge or Modrinth.
This record models the relationship between the current project and another referenced project, typically used to express requirements such as:
- required dependencies
- optional dependencies
- embedded libraries
- tooling or compatibility addons
The values here are serialized to JSON using Gson and included as part of the upload request payload.
-
Constructor Summary
ConstructorsConstructorDescriptionDependencyMetadata(String projectId, DependencyType dependencyType) Creates an instance of aDependencyMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedependencyTyperecord 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 theprojectIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DependencyMetadata
Creates an instance of aDependencyMetadatarecord class.- Parameters:
projectId- the value for theprojectIdrecord componentdependencyType- the value for thedependencyTyperecord component
-
-
Method Details
-
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). -
projectId
Returns the value of theprojectIdrecord component.- Returns:
- the value of the
projectIdrecord component
-
dependencyType
Returns the value of thedependencyTyperecord component.- Returns:
- the value of the
dependencyTyperecord component
-