Record Class OriginalDiff
java.lang.Object
java.lang.Record
org.variantsync.studies.evolution.simulation.diff.components.OriginalDiff
- Record Components:
fileDiffs
- The differences of the changed files.
- All Implemented Interfaces:
IDiffComponent
A OriginalDiff holds the difference between two versions of a software project. The difference is represented by the
patches of all changed files. The patches are grouped by file and represented by FileDiff objects.
Each FileDiff contains the patches made to a specific file as specified by UNIX diff.
-
Constructor Summary
ConstructorsConstructorDescriptionOriginalDiff
(List<FileDiff> fileDiffs) Creates an instance of aOriginalDiff
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefileDiffs
record component.final int
hashCode()
Returns a hash code value for this object.boolean
isEmpty()
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
-
OriginalDiff
Creates an instance of aOriginalDiff
record class.- Parameters:
fileDiffs
- the value for thefileDiffs
record component
-
-
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
-
isEmpty
public boolean isEmpty() -
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)
. -
fileDiffs
Returns the value of thefileDiffs
record component.- Returns:
- the value of the
fileDiffs
record component
-