Record Class FileChange
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.app.model.FileChange
- Record Components:
added- added lines, or-1if not known (nothing is shown then)deleted- deleted lines, or-1if not known
public record FileChange(char status, String path, boolean staged, int added, int deleted)
extends Record
A changed file.
status is one of M (modified), A (added), D (deleted) or U (unmerged: has conflicts).-
Constructor Summary
ConstructorsConstructorDescriptionFileChange(char status, String path) An unstaged file without line counts.FileChange(char status, String path, boolean staged) A file without line counts.FileChange(char status, String path, boolean staged, int added, int deleted) Creates an instance of aFileChangerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintadded()Returns the value of theaddedrecord component.base()The file name without its folder.intdeleted()Returns the value of thedeletedrecord component.dir()The folder of the file, empty for the top level.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.path()Returns the value of thepathrecord component.booleanstaged()Returns the value of thestagedrecord component.charstatus()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.withStaged(boolean s) The same file, staged or not.
-
Constructor Details
-
FileChange
A file without line counts. -
FileChange
An unstaged file without line counts. -
FileChange
Creates an instance of aFileChangerecord class.
-
-
Method Details
-
base
The file name without its folder. -
dir
The folder of the file, empty for the top level. -
withStaged
The same file, staged or not. -
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 '=='. -
status
public char status()Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
staged
public boolean staged()Returns the value of thestagedrecord component.- Returns:
- the value of the
stagedrecord 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
-