Record Class CommitStat
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.CommitStat
A commit with the files it changed and how many lines, for statistics. A merge commit has no files (its changes are those of the
commits it merges); a binary file counts as zero lines.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne changed file:addedanddeletedlines. -
Constructor Summary
ConstructorsConstructorDescriptionCommitStat(CommitInfo commit, List<CommitStat.FileStat> files) Creates an instance of aCommitStatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintadded()Total added lines over all files of the commit.commit()Returns the value of thecommitrecord component.intdeleted()Total deleted lines over all files of the commit.final booleanIndicates whether some other object is "equal to" this one.files()Returns the value of thefilesrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CommitStat
Creates an instance of aCommitStatrecord class.- Parameters:
commit- the value for thecommitrecord componentfiles- the value for thefilesrecord component
-
-
Method Details
-
added
public int added()Total added lines over all files of the commit. -
deleted
public int deleted()Total deleted lines over all files of the commit. -
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. -
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. -
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). -
commit
Returns the value of thecommitrecord component.- Returns:
- the value of the
commitrecord component
-
files
Returns the value of thefilesrecord component.- Returns:
- the value of the
filesrecord component
-