Record Class GitPatch.SimpleGitPatch
java.lang.Object
java.lang.Record
org.variantsync.diffdetective.diff.git.GitPatch.SimpleGitPatch
- Record Components:
getDiff
- The diff in text form.getChangeType
- The change type of this patch (e.g., file insertion or modification).oldFileName
- The name of the patched file before the edit.newFileName
- The name of the patched file after the edit.getCommitHash
- The hash of the commit introducing the change.getParentCommitHash
- The hash of the parent commit regarding which the diff was created.
- All Implemented Interfaces:
GitPatch
,TextBasedDiff
,VariationDiffSource
- Enclosing interface:
GitPatch
public static record GitPatch.SimpleGitPatch(String getDiff, org.eclipse.jgit.diff.DiffEntry.ChangeType getChangeType, String oldFileName, String newFileName, String getCommitHash, String getParentCommitHash)
extends Record
implements GitPatch
Minimal default implementation of
GitPatch
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.variantsync.diffdetective.diff.git.GitPatch
GitPatch.SimpleGitPatch
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.eclipse.jgit.diff.DiffEntry.ChangeType
The field for thegetChangeType
record component.private final String
The field for thegetCommitHash
record component.private final String
The field for thegetDiff
record component.private final String
The field for thegetParentCommitHash
record component.private final String
The field for thenewFileName
record component.private final String
The field for theoldFileName
record component.Fields inherited from interface org.variantsync.diffdetective.variation.diff.source.VariationDiffSource
Unknown
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.org.eclipse.jgit.diff.DiffEntry.ChangeType
Returns the value of thegetChangeType
record component.Returns the value of thegetCommitHash
record component.getDiff()
Returns the value of thegetDiff
record component.getFileName
(Time time) Returns the name of the patched file at the given time.Returns the value of thegetParentCommitHash
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of thenewFileName
record component.Returns the value of theoldFileName
record component.Creates a shallow clone.toString()
Returns a string representation of this record class.
-
Field Details
-
getDiff
The field for thegetDiff
record component. -
getChangeType
private final org.eclipse.jgit.diff.DiffEntry.ChangeType getChangeTypeThe field for thegetChangeType
record component. -
oldFileName
The field for theoldFileName
record component. -
newFileName
The field for thenewFileName
record component. -
getCommitHash
The field for thegetCommitHash
record component. -
getParentCommitHash
The field for thegetParentCommitHash
record component.
-
-
Constructor Details
-
SimpleGitPatch
public SimpleGitPatch(String getDiff, org.eclipse.jgit.diff.DiffEntry.ChangeType getChangeType, String oldFileName, String newFileName, String getCommitHash, String getParentCommitHash) Creates an instance of aSimpleGitPatch
record class.- Parameters:
getDiff
- the value for thegetDiff
record componentgetChangeType
- the value for thegetChangeType
record componentoldFileName
- the value for theoldFileName
record componentnewFileName
- the value for thenewFileName
record componentgetCommitHash
- the value for thegetCommitHash
record componentgetParentCommitHash
- the value for thegetParentCommitHash
record component
-
-
Method Details
-
getFileName
Description copied from interface:GitPatch
Returns the name of the patched file at the given time.- Specified by:
getFileName
in interfaceGitPatch
-
shallowClone
Description copied from interface:GitPatch
Creates a shallow clone. A shallow clone should return the very same values for the methods of this interface. Other behaviour is unspecified.- Specified by:
shallowClone
in interfaceGitPatch
- Returns:
- A clone that acts equal with respect to this interface.
-
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)
. -
getDiff
Returns the value of thegetDiff
record component.- Specified by:
getDiff
in interfaceTextBasedDiff
- Returns:
- the value of the
getDiff
record component
-
getChangeType
public org.eclipse.jgit.diff.DiffEntry.ChangeType getChangeType()Returns the value of thegetChangeType
record component.- Specified by:
getChangeType
in interfaceGitPatch
- Returns:
- the value of the
getChangeType
record component
-
oldFileName
Returns the value of theoldFileName
record component.- Returns:
- the value of the
oldFileName
record component
-
newFileName
Returns the value of thenewFileName
record component.- Returns:
- the value of the
newFileName
record component
-
getCommitHash
Returns the value of thegetCommitHash
record component.- Specified by:
getCommitHash
in interfaceGitPatch
- Returns:
- the value of the
getCommitHash
record component
-
getParentCommitHash
Returns the value of thegetParentCommitHash
record component.- Specified by:
getParentCommitHash
in interfaceGitPatch
- Returns:
- the value of the
getParentCommitHash
record component
-