Record Class DiffLine
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.app.model.DiffLine
- Record Components:
action- for a hunk header of the working tree:"stage"or"unstage", the action the view offers for that hunk;nullotherwise
public record DiffLine(char type, Integer oldNo, Integer newNo, String text, String action)
extends Record
One line of a unified diff.
type is '@' (hunk header), '+', '-', ' ', or 'S' for the title of a section
("Unstaged changes").-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.newNo()Returns the value of thenewNorecord component.oldNo()Returns the value of theoldNorecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.chartype()Returns the value of thetyperecord component.withAction(String newAction) The same line with the action of its hunk or line selection, e.g.
-
Constructor Details
-
DiffLine
A line without an action. -
DiffLine
Creates an instance of aDiffLinerecord class.- Parameters:
type- the value for thetyperecord componentoldNo- the value for theoldNorecord componentnewNo- the value for thenewNorecord componenttext- the value for thetextrecord componentaction- the value for theactionrecord component
-
-
Method Details
-
withAction
The same line with the action of its hunk or line selection, e.g. "stage" or "unstage". -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
public char type()Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
oldNo
Returns the value of theoldNorecord component.- Returns:
- the value of the
oldNorecord component
-
newNo
Returns the value of thenewNorecord component.- Returns:
- the value of the
newNorecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-