Record Class RepositoryKey

java.lang.Object
java.lang.Record
network.ike.workspace.cascade.RepositoryKey
Record Components:
url - the canonical https://host/owner/repo form of the SCM URL

public record RepositoryKey(String url) extends Record
The identity of a release-cascade node — a repository, named by its <scm> URL (IKE-Network/ike-issues#496 part C).

A release node is a repository, not a coordinate. A single reactor produces many coordinates (ike-tooling alone produces ike-maven-plugin, ike-build-standards, ike-workspace-model, and more) but the cascade releases the repository as one unit. The join key that collapses many coordinates onto one node is the <scm> URL each coordinate inherits from its reactor-root POM. RepositoryKey is that join key.

SCM URLs arrive in many syntactic forms — scm:git:https:// prefixed, plain https://, git@host:owner/repo SSH shorthand, ssh:// explicit, with or without a trailing .git. RepositoryKey canonicalises every form to a single normalised https://host/owner/repo string, so two keys derived from different syntactic variants of the same URL compare equal.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Canonical constructor — validates and normalises the URL.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    fromScm(org.apache.maven.api.model.Scm scm)
    Builds a key from a Maven Scm block, preferring <url> over <connection> when both are declared.
    final int
    Returns a hash code value for this object.
    of(String scmUrl)
    Builds a key from any syntactic form of an SCM URL.
    final String
    Returns a string representation of this record class.
    url()
    Returns the value of the url record component.

    Methods inherited from class Object

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

    • RepositoryKey

      public RepositoryKey(String url)
      Canonical constructor — validates and normalises the URL.
  • Method Details

    • fromScm

      public static RepositoryKey fromScm(org.apache.maven.api.model.Scm scm)
      Builds a key from a Maven Scm block, preferring <url> over <connection> when both are declared.
      Parameters:
      scm - the SCM block; may be null
      Returns:
      the key, or null when scm is null or declares neither a URL nor a connection
    • of

      public static RepositoryKey of(String scmUrl)
      Builds a key from any syntactic form of an SCM URL.
      Parameters:
      scmUrl - the SCM URL or connection string; must not be null or blank
      Returns:
      the canonicalised key
      Throws:
      IllegalArgumentException - if scmUrl is null or blank
    • 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.
    • url

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