Record Class ModuleCoordinate
java.lang.Object
java.lang.Record
io.github.duckasteroid.agentdocs.resolve.task.model.ModuleCoordinate
- All Implemented Interfaces:
SkillSource
public record ModuleCoordinate(String group, String artifact, String version)
extends Record
implements SkillSource
Represents a Maven GAV coordinate for a library/dependency.
-
Constructor Summary
ConstructorsConstructorDescriptionModuleCoordinate(String group, String artifact, String version) Creates an instance of aModuleCoordinaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionartifact()Returns the value of theartifactrecord component.Untruncated, normalized candidate skill name using only the artifact name — the shortest and most readable tier.describe()Human-readable identity for logging (a GAV string, orplugin:<id>).final booleanIndicates whether some other object is "equal to" this one.finalizeSkillName(String normalizedKey) Applies the length-limit and deterministic hash-suffix rule to a chosen, already-normalized candidate key (fromartifactNameKey(),groupArtifactNameKey(), or a rawgroup-artifact-versionstring), producing the final skill folder name.gav()Returns canonical Maven GAV text form.group()Returns the value of thegrouprecord component.Untruncated, normalized candidate skill name using group and artifact — the fallback tier whenartifactNameKey()collides with another coordinate.final inthashCode()Returns a hash code value for this object.Generates a skill-folder-compatible identifier derived from the full GAV.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
ModuleCoordinate
Creates an instance of aModuleCoordinaterecord class.- Parameters:
group- the value for thegrouprecord componentartifact- the value for theartifactrecord componentversion- the value for theversionrecord component
-
-
Method Details
-
gav
Returns canonical Maven GAV text form.- Returns:
group:artifact:version
-
describe
Human-readable identity for logging (a GAV string, orplugin:<id>).- Specified by:
describein interfaceSkillSource- Returns:
- display string
-
skillName
Generates a skill-folder-compatible identifier derived from the full GAV. This is the last-resort tier used bySkillNameAssigneronly when a shorter, more readable candidate (seeartifactNameKey(),groupArtifactNameKey()) collides with another coordinate being resolved in the same run.The generated name is deterministic, lower-case, and constrained to skill naming requirements. Names longer than the maximum length are truncated with a hash suffix.
- Specified by:
skillNamein interfaceSkillSource- Returns:
- normalized skill folder name
-
artifactNameKey
Untruncated, normalized candidate skill name using only the artifact name — the shortest and most readable tier. Multiple coordinates with different groups can share the same artifact name, so callers must check for collisions across the full candidate set before relying on this tier (seeSkillNameAssigner).- Specified by:
artifactNameKeyin interfaceSkillSource- Returns:
- normalized artifact-only candidate key
-
groupArtifactNameKey
Untruncated, normalized candidate skill name using group and artifact — the fallback tier whenartifactNameKey()collides with another coordinate. Two different versions of the same module would still collide at this tier, but a single resolved configuration only ever selects one version per group:artifact, so this is effectively unique in practice.- Specified by:
groupArtifactNameKeyin interfaceSkillSource- Returns:
- normalized group-artifact candidate key
-
finalizeSkillName
Applies the length-limit and deterministic hash-suffix rule to a chosen, already-normalized candidate key (fromartifactNameKey(),groupArtifactNameKey(), or a rawgroup-artifact-versionstring), producing the final skill folder name.- Specified by:
finalizeSkillNamein interfaceSkillSource- Parameters:
normalizedKey- a normalized candidate key- Returns:
- skill-folder-compatible name, truncated with a hash suffix if needed
-
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). -
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
artifact
Returns the value of theartifactrecord component.- Returns:
- the value of the
artifactrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-