Record Class FineDiff
java.lang.Object
java.lang.Record
org.variantsync.studies.evolution.simulation.diff.components.FineDiff
- Record Components:
content- The line-level changes of the changed files.
- All Implemented Interfaces:
IDiffComponent
A FineDiff holds the difference between two versions of a software project. The difference is represented by the line-level
patches of all changed files. The patches are grouped by file and represented by FileDiff objects.
Each FileDiff contains the line-level patches made to a specific file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.Parse all patches in the difference and extract the changes source code lines without the patches' context lines.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.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
-
FineDiff
Creates an instance of aFineDiffrecord class.- Parameters:
content- the value for thecontentrecord component
-
-
Method Details
-
determineChangedLines
Parse all patches in the difference and extract the changes source code lines without the patches' context lines.- Parameters:
diff- The difference from which changed lines are to be extracted- Returns:
- A list of all changed lines (i.e., added and removed source code)
-
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). -
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-