Record Class Commit

java.lang.Object
java.lang.Record
io.github.joke.conventionalversion.calc.Commit
Record Components:
sha - the commit itself, so a package's range can be sliced at its own base commit
message - the raw commit message, header and body
paths - repository-relative paths the commit changed, against its first parent

public record Commit(String sha, String message, List<String> paths) extends Record
One commit in the analysed range, with the paths it touched.

The paths decide which packages the commit counts for: release-please attributes a commit strictly by path, so a commit touching only a package's files bumps only that package.

  • Constructor Details

    • Commit

      public Commit(String sha, String message, List<String> paths)
      Creates an instance of a Commit record class.
      Parameters:
      sha - the value for the sha record component
      message - the value for the message record component
      paths - the value for the paths record component
  • Method Details

    • 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.
    • sha

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

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

      public List<String> paths()
      Returns the value of the paths record component.
      Returns:
      the value of the paths record component