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 topackages- each declared package with the version it resolved tounmatched- 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne package and what it resolved to. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe version of a project that no package claims. -
Constructor Summary
ConstructorsConstructorDescriptionVersionCatalogue(String repositoryRoot, List<VersionCatalogue.PackageVersion> packages, VersionResult unmatched) Creates an instance of aVersionCataloguerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.forProject(Path projectDirectory) The version for a project directory, by the package whose claim is deepest.final inthashCode()Returns a hash code value for this object.packages()Returns the value of thepackagesrecord component.Returns the value of therepositoryRootrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theunmatchedrecord component.static VersionResultunreleasable(String sha)
-
Field Details
-
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
-
VersionCatalogue
public VersionCatalogue(String repositoryRoot, List<VersionCatalogue.PackageVersion> packages, VersionResult unmatched) Creates an instance of aVersionCataloguerecord class.- Parameters:
repositoryRoot- the value for therepositoryRootrecord componentpackages- the value for thepackagesrecord componentunmatched- the value for theunmatchedrecord component
-
-
Method Details
-
unreleasable
-
forProject
The version for a project directory, by the package whose claim is deepest. -
toString
-
hashCode
-
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). -
repositoryRoot
Returns the value of therepositoryRootrecord component.- Returns:
- the value of the
repositoryRootrecord component
-
packages
-
unmatched
-