Record Class VersionCatalogue

java.lang.Object
java.lang.Record
io.github.joke.conventionalversion.VersionCatalogue
Record Components:
repositoryRoot - the git root, which project directories are made relative to
packages - each declared package with the version it resolved to
unmatched - the result for a project no package claims
All Implemented Interfaces:
Serializable

public record VersionCatalogue(String repositoryRoot, List<VersionCatalogue.PackageVersion> packages, VersionResult unmatched) extends Record implements Serializable
Every package's version, and the answer for anything no package claims.

Computed once per build and then only read, so assigning a project's version is a lookup rather than a calculation, and no project ever reaches into another.

See Also:
  • Field Details

    • UNRELEASED_VERSION

      public static final String UNRELEASED_VERSION
      The version of a project that no package claims. Constant, so an unreleased module's output does not change when an unrelated package releases, and never bare, because it is never a release.
      See Also:
  • Constructor Details

  • Method Details

    • unreleasable

      public static VersionResult unreleasable(String sha)
    • forProject

      public VersionResult forProject(Path projectDirectory)
      The version for a project directory, by the package whose claim is deepest.
    • 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.
    • repositoryRoot

      public String repositoryRoot()
      Returns the value of the repositoryRoot record component.
      Returns:
      the value of the repositoryRoot record component
    • packages

      Returns the value of the packages record component.
      Returns:
      the value of the packages record component
    • unmatched

      public VersionResult unmatched()
      Returns the value of the unmatched record component.
      Returns:
      the value of the unmatched record component