Record Class Hunks.Hunk
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.Hunks.Hunk
- Enclosing class:
Hunks
public static record Hunks.Hunk(int oldStart, int oldCount, int newStart, int newCount)
extends Record
A hunk header
@@ -oldStart,oldCount +newStart,newCount @@; a missing count means one line.-
Constructor Summary
ConstructorsConstructorDescriptionHunk(int oldStart, int oldCount, int newStart, int newCount) Creates an instance of aHunkrecord class. -
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.key()Identifies the hunk within its diff, e.g.intnewCount()Returns the value of thenewCountrecord component.intnewStart()Returns the value of thenewStartrecord component.intoldCount()Returns the value of theoldCountrecord component.intoldStart()Returns the value of theoldStartrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Hunk
public Hunk(int oldStart, int oldCount, int newStart, int newCount) Creates an instance of aHunkrecord class.- Parameters:
oldStart- the value for theoldStartrecord componentoldCount- the value for theoldCountrecord componentnewStart- the value for thenewStartrecord componentnewCount- the value for thenewCountrecord component
-
-
Method Details
-
key
Identifies the hunk within its diff, e.g.-3,2 +3,4. -
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 with '=='. -
oldStart
public int oldStart()Returns the value of theoldStartrecord component.- Returns:
- the value of the
oldStartrecord component
-
oldCount
public int oldCount()Returns the value of theoldCountrecord component.- Returns:
- the value of the
oldCountrecord component
-
newStart
public int newStart()Returns the value of thenewStartrecord component.- Returns:
- the value of the
newStartrecord component
-
newCount
public int newCount()Returns the value of thenewCountrecord component.- Returns:
- the value of the
newCountrecord component
-