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
FieldsModifier and TypeFieldDescriptionprivate final org.eclipse.jgit.diff.DiffEntry.ChangeTypeThe field for thegetChangeTyperecord component.private final StringThe field for thegetCommitHashrecord component.private final StringThe field for thegetDiffrecord component.private final StringThe field for thegetParentCommitHashrecord component.private final StringThe field for thenewFileNamerecord component.private final StringThe field for theoldFileNamerecord component.Fields inherited from interface org.variantsync.diffdetective.variation.diff.source.VariationDiffSource
Unknown -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.org.eclipse.jgit.diff.DiffEntry.ChangeTypeReturns the value of thegetChangeTyperecord component.Returns the value of thegetCommitHashrecord component.getDiff()Returns the value of thegetDiffrecord component.getFileName(Time time) Returns the name of the patched file at the given time.Returns the value of thegetParentCommitHashrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thenewFileNamerecord component.Returns the value of theoldFileNamerecord component.Creates a shallow clone.toString()Returns a string representation of this record class.
-
Field Details
-
getDiff
The field for thegetDiffrecord component. -
getChangeType
private final org.eclipse.jgit.diff.DiffEntry.ChangeType getChangeTypeThe field for thegetChangeTyperecord component. -
oldFileName
The field for theoldFileNamerecord component. -
newFileName
The field for thenewFileNamerecord component. -
getCommitHash
The field for thegetCommitHashrecord component. -
getParentCommitHash
The field for thegetParentCommitHashrecord 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 aSimpleGitPatchrecord class.- Parameters:
getDiff- the value for thegetDiffrecord componentgetChangeType- the value for thegetChangeTyperecord componentoldFileName- the value for theoldFileNamerecord componentnewFileName- the value for thenewFileNamerecord componentgetCommitHash- the value for thegetCommitHashrecord componentgetParentCommitHash- the value for thegetParentCommitHashrecord component
-
-
Method Details
-
getFileName
Description copied from interface:GitPatchReturns the name of the patched file at the given time.- Specified by:
getFileNamein interfaceGitPatch
-
shallowClone
Description copied from interface:GitPatchCreates a shallow clone. A shallow clone should return the very same values for the methods of this interface. Other behaviour is unspecified.- Specified by:
shallowClonein 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 thegetDiffrecord component.- Specified by:
getDiffin interfaceTextBasedDiff- Returns:
- the value of the
getDiffrecord component
-
getChangeType
public org.eclipse.jgit.diff.DiffEntry.ChangeType getChangeType()Returns the value of thegetChangeTyperecord component.- Specified by:
getChangeTypein interfaceGitPatch- Returns:
- the value of the
getChangeTyperecord component
-
oldFileName
Returns the value of theoldFileNamerecord component.- Returns:
- the value of the
oldFileNamerecord component
-
newFileName
Returns the value of thenewFileNamerecord component.- Returns:
- the value of the
newFileNamerecord component
-
getCommitHash
Returns the value of thegetCommitHashrecord component.- Specified by:
getCommitHashin interfaceGitPatch- Returns:
- the value of the
getCommitHashrecord component
-
getParentCommitHash
Returns the value of thegetParentCommitHashrecord component.- Specified by:
getParentCommitHashin interfaceGitPatch- Returns:
- the value of the
getParentCommitHashrecord component
-