Record Class ReleasePackage

java.lang.Object
java.lang.Record
io.github.joke.conventionalversion.config.ReleasePackage
Record Components:
path - the package key, . for the repository root
component - the component its tags carry, empty when it has none
excludePaths - release-please exclude-paths, subtrees this package does not claim
All Implemented Interfaces:
Serializable

public record ReleasePackage(String path, String component, List<String> excludePaths, TagFormat tagFormat, VersionPolicy policy) extends Record implements Serializable
One releasable unit, as release-please declares it.

The path is the key the manifest records a version under, and also the root of the paths this package claims. A package with no component — which is what release-type: simple derives when neither component nor package-name is set — is tagged by version alone.

See Also:
  • Constructor Details

    • ReleasePackage

      public ReleasePackage(String path, String component, List<String> excludePaths, TagFormat tagFormat, VersionPolicy policy)
      Creates an instance of a ReleasePackage record class.
      Parameters:
      path - the value for the path record component
      component - the value for the component record component
      excludePaths - the value for the excludePaths record component
      tagFormat - the value for the tagFormat record component
      policy - the value for the policy record component
  • Method Details

    • tag

      public String tag(SemanticVersion version)
    • tagPattern

      public String tagPattern()
      The tag this package renders for any version. Two packages sharing one are indistinguishable by tag, which is a configuration that cannot be resolved rather than one that resolves oddly.
    • claims

      public boolean claims(String candidate)
      Whether a repository-relative path belongs to this package.
    • depth

      public int depth()
      How specific this package's claim is, so the deepest declared package wins a contested path.
    • 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.
    • path

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

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

      public List<String> excludePaths()
      Returns the value of the excludePaths record component.
      Returns:
      the value of the excludePaths record component
    • tagFormat

      public TagFormat tagFormat()
      Returns the value of the tagFormat record component.
      Returns:
      the value of the tagFormat record component
    • policy

      public VersionPolicy policy()
      Returns the value of the policy record component.
      Returns:
      the value of the policy record component