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

    Constructors
    Constructor
    Description
    ModuleCoordinate(String group, String artifact, String version)
    Creates an instance of a ModuleCoordinate record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the artifact record component.
    Untruncated, normalized candidate skill name using only the artifact name — the shortest and most readable tier.
    Human-readable identity for logging (a GAV string, or plugin:<id>).
    final boolean
    Indicates 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 (from artifactNameKey(), groupArtifactNameKey(), or a raw group-artifact-version string), producing the final skill folder name.
    gav()
    Returns canonical Maven GAV text form.
    Returns the value of the group record component.
    Untruncated, normalized candidate skill name using group and artifact — the fallback tier when artifactNameKey() collides with another coordinate.
    final int
    Returns a hash code value for this object.
    Generates a skill-folder-compatible identifier derived from the full GAV.
    final String
    Returns a string representation of this record class.
    Returns the value of the version record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ModuleCoordinate

      public ModuleCoordinate(String group, String artifact, String version)
      Creates an instance of a ModuleCoordinate record class.
      Parameters:
      group - the value for the group record component
      artifact - the value for the artifact record component
      version - the value for the version record component
  • Method Details

    • gav

      public String gav()
      Returns canonical Maven GAV text form.
      Returns:
      group:artifact:version
    • describe

      public String describe()
      Human-readable identity for logging (a GAV string, or plugin:<id>).
      Specified by:
      describe in interface SkillSource
      Returns:
      display string
    • skillName

      public String skillName()
      Generates a skill-folder-compatible identifier derived from the full GAV. This is the last-resort tier used by SkillNameAssigner only when a shorter, more readable candidate (see artifactNameKey(), 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:
      skillName in interface SkillSource
      Returns:
      normalized skill folder name
    • artifactNameKey

      public String 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 (see SkillNameAssigner).
      Specified by:
      artifactNameKey in interface SkillSource
      Returns:
      normalized artifact-only candidate key
    • groupArtifactNameKey

      public String groupArtifactNameKey()
      Untruncated, normalized candidate skill name using group and artifact — the fallback tier when artifactNameKey() 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:
      groupArtifactNameKey in interface SkillSource
      Returns:
      normalized group-artifact candidate key
    • finalizeSkillName

      public String finalizeSkillName(String normalizedKey)
      Applies the length-limit and deterministic hash-suffix rule to a chosen, already-normalized candidate key (from artifactNameKey(), groupArtifactNameKey(), or a raw group-artifact-version string), producing the final skill folder name.
      Specified by:
      finalizeSkillName in interface SkillSource
      Parameters:
      normalizedKey - a normalized candidate key
      Returns:
      skill-folder-compatible name, truncated with a hash suffix if needed
    • 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.
    • group

      public String group()
      Returns the value of the group record component.
      Returns:
      the value of the group record component
    • artifact

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

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