Record Class ChangedFile
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.ChangedFile
- Record Components:
path- path relative to the work tree, using/kind- what happened to the fileadded- added lines, or-1for binary filesdeleted- deleted lines, or-1for binary files
public record ChangedFile(String path, ChangedFile.Kind kind, int added, int deleted)
extends Record
A file changed by a commit (compared with its first parent).
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionChangedFile(String path, ChangedFile.Kind kind, int added, int deleted) Creates an instance of aChangedFilerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintadded()Returns the value of theaddedrecord component.intdeleted()Returns the value of thedeletedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisBinary()Whether the line counts are unknown because git treats the file as binary.kind()Returns the value of thekindrecord component.path()Returns the value of thepathrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
isBinary
public boolean isBinary()Whether the line counts are unknown because git treats the file as binary. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
added
public int added()Returns the value of theaddedrecord component.- Returns:
- the value of the
addedrecord component
-
deleted
public int deleted()Returns the value of thedeletedrecord component.- Returns:
- the value of the
deletedrecord component
-