Record Class FileDiff
java.lang.Object
java.lang.Record
org.variantsync.studies.evolution.simulation.diff.components.FileDiff
- Record Components:
header
- The header of UNIX diff's outputhunks
- The hunks (i.e., change groups) of the file's differenceoldFile
- The path to the old version of the filenewFile
- The path to the new version of the file
- All Implemented Interfaces:
IDiffComponent
public record FileDiff(List<String> header, List<Hunk> hunks, Path oldFile, Path newFile)
extends Record
implements IDiffComponent
A FileDiff holds the difference between two versions of a specific file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.header()
Returns the value of theheader
record component.hunks()
Returns the value of thehunks
record component.newFile()
Returns the value of thenewFile
record component.oldFile()
Returns the value of theoldFile
record component.toLines()
Parse this component back into a list of lines that can be added to a diff file meant as input for unix patchfinal String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toLines
Description copied from interface:IDiffComponent
Parse this component back into a list of lines that can be added to a diff file meant as input for unix patch- Specified by:
toLines
in interfaceIDiffComponent
- Returns:
- the lines of the part of the diff that this component represents
-
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)
. -
header
Returns the value of theheader
record component.- Returns:
- the value of the
header
record component
-
hunks
Returns the value of thehunks
record component.- Returns:
- the value of the
hunks
record component
-
oldFile
Returns the value of theoldFile
record component.- Returns:
- the value of the
oldFile
record component
-
newFile
Returns the value of thenewFile
record component.- Returns:
- the value of the
newFile
record component
-