Package io.github.slimjar.resolver.data
Record Class Dependency
java.lang.Object
java.lang.Record
io.github.slimjar.resolver.data.Dependency
- All Implemented Interfaces:
Comparable<Dependency>
public record Dependency(@NotNull String groupId, @NotNull String artifactId, @NotNull String version, @Nullable String snapshotId, @NotNull Collection<Dependency> transitive)
extends Record
implements Comparable<Dependency>
-
Constructor Summary
ConstructorsConstructorDescriptionDependency(@NotNull String groupId, @NotNull String artifactId, @NotNull String version, @Nullable String snapshotId, @NotNull Collection<Dependency> transitive) Creates an instance of aDependencyrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull StringReturns the value of theartifactIdrecord component.intcompareTo(@NotNull Dependency o) booleanIndicates whether some other object is "equal to" this one.@NotNull StringgroupId()Returns the value of thegroupIdrecord component.inthashCode()Returns a hash code value for this object.booleanstatic @NotNull Dependencysnapshot()@Nullable StringReturns the value of thesnapshotIdrecord component.@NotNull StringtoString()Returns a string representation of this record class.@NotNull Collection<Dependency>Returns the value of thetransitiverecord component.@NotNull Stringversion()Returns the value of theversionrecord component.voidwrite(@NotNull DataOutput out)
-
Constructor Details
-
Dependency
public Dependency(@NotNull @NotNull String groupId, @NotNull @NotNull String artifactId, @NotNull @NotNull String version, @Nullable @Nullable String snapshotId, @NotNull @NotNull Collection<Dependency> transitive) Creates an instance of aDependencyrecord class.- Parameters:
groupId- the value for thegroupIdrecord componentartifactId- the value for theartifactIdrecord componentversion- the value for theversionrecord componentsnapshotId- the value for thesnapshotIdrecord componenttransitive- the value for thetransitiverecord component
-
-
Method Details
-
read
@NotNull @Contract(pure=true) public static @NotNull Dependency read(@NotNull @NotNull DataInput in) throws IOException - Throws:
IOException
-
isSnapshot
public boolean isSnapshot() -
snapshot
-
write
- Throws:
IOException
-
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. -
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). -
hashCode
@Contract(pure=true) public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
compareTo
@Contract(pure=true) public int compareTo(@NotNull @NotNull Dependency o) throws NotComparableDependencyException - Specified by:
compareToin interfaceComparable<Dependency>- Throws:
NotComparableDependencyException
-
groupId
Returns the value of thegroupIdrecord component.- Returns:
- the value of the
groupIdrecord component
-
artifactId
Returns the value of theartifactIdrecord component.- Returns:
- the value of the
artifactIdrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
snapshotId
Returns the value of thesnapshotIdrecord component.- Returns:
- the value of the
snapshotIdrecord component
-
transitive
Returns the value of thetransitiverecord component.- Returns:
- the value of the
transitiverecord component
-