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 booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.header()Returns the value of theheaderrecord component.hunks()Returns the value of thehunksrecord component.newFile()Returns the value of thenewFilerecord component.oldFile()Returns the value of theoldFilerecord 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 StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toLines
Description copied from interface:IDiffComponentParse this component back into a list of lines that can be added to a diff file meant as input for unix patch- Specified by:
toLinesin 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 theheaderrecord component.- Returns:
- the value of the
headerrecord component
-
hunks
Returns the value of thehunksrecord component.- Returns:
- the value of the
hunksrecord component
-
oldFile
Returns the value of theoldFilerecord component.- Returns:
- the value of the
oldFilerecord component
-
newFile
Returns the value of thenewFilerecord component.- Returns:
- the value of the
newFilerecord component
-