Class FileDiffOutput
java.lang.Object
com.google.gerrit.server.patch.filediff.FileDiffOutput
- All Implemented Interfaces:
- Serializable
File diff for a single file path. Produced as output of the 
FileDiffCache.- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic enum
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanA boolean indicating if all underlying edits of the file diff are due to rebase.static FileDiffOutput.Builderbuilder()abstract Patch.ChangeTypeThe change type of the underlying file, e.g.abstract ComparisonTypeComparison type of old and new commits: against another patchset, parent or auto-merge.static FileDiffOutputcreateNegative(String filePath, org.eclipse.jgit.lib.ObjectId oldCommitId, org.eclipse.jgit.lib.ObjectId newCommitId) Create a negative file diff.intReturns the number of deleted lines for the file diff.abstract com.google.common.collect.ImmutableList<TaggedEdit>edits()The list of edits resulting from the diff hunks of the file.static FileDiffOutputempty(String filePath, org.eclipse.jgit.lib.ObjectId oldCommitId, org.eclipse.jgit.lib.ObjectId newCommitId) Returns an entity representing an unchanged file between two commits.abstract com.google.common.collect.ImmutableList<String>A list of strings representation of the header lines of theFileHeaderthat is produced as output of the diff.intReturns the number of inserted lines for the file diff.booleanisEmpty()Returns true if this entity represents an unchanged file between two commits.booleanReturnstrueif the diff computation was not able to compute a diff.negative()Returnstrueif the diff computation was not able to compute a diff, i.e.abstract org.eclipse.jgit.lib.ObjectIdThe 20 bytes SHA-1 object ID of the new git commit used in the diff.abstract Optional<Patch.FileMode>newMode()The file mode of the new file at the new git tree diff identified bynewCommitId()()}.newPath()The file path at the new commit.abstract org.eclipse.jgit.lib.ObjectIdThe 20 bytes SHA-1 object ID of the old git commit used in the diff, orObjectId.zeroId()ifnewCommitId()was a root commit.abstract Optional<Patch.FileMode>oldMode()The file mode of the old file at the old git tree diff identified byoldCommitId()()}.oldPath()The file path at the old commit.abstract Optional<Patch.PatchType>The patch type of the underlying file, e.g.abstract longsize()The file size at the new commit.abstract longDifference in file size between the old and new commits.abstract FileDiffOutput.Builderintweight()
- 
Constructor Details- 
FileDiffOutputpublic FileDiffOutput()
 
- 
- 
Method Details- 
oldCommitIdpublic abstract org.eclipse.jgit.lib.ObjectId oldCommitId()The 20 bytes SHA-1 object ID of the old git commit used in the diff, orObjectId.zeroId()ifnewCommitId()was a root commit.
- 
newCommitIdpublic abstract org.eclipse.jgit.lib.ObjectId newCommitId()The 20 bytes SHA-1 object ID of the new git commit used in the diff.
- 
comparisonTypeComparison type of old and new commits: against another patchset, parent or auto-merge.
- 
oldPathThe file path at the old commit. Returns an empty Optional ifchangeType()is equal toPatch.ChangeType.ADDED.
- 
newPathThe file path at the new commit. Returns an empty optional ifchangeType()is equal toPatch.ChangeType.DELETED.
- 
getDefaultPath
- 
oldModeThe file mode of the old file at the old git tree diff identified byoldCommitId()()}.
- 
newModeThe file mode of the new file at the new git tree diff identified bynewCommitId()()}.
- 
changeTypeThe change type of the underlying file, e.g. added, deleted, renamed, etc...
- 
patchTypeThe patch type of the underlying file, e.g. unified, binary , etc...
- 
headerLinesA list of strings representation of the header lines of theFileHeaderthat is produced as output of the diff.
- 
editsThe list of edits resulting from the diff hunks of the file.
- 
sizepublic abstract long size()The file size at the new commit.
- 
sizeDeltapublic abstract long sizeDelta()Difference in file size between the old and new commits.
- 
negativeReturnstrueif the diff computation was not able to compute a diff, i.e. for diffs taking a very long time to compute. We cache negative result in this case.
- 
toBuilder
- 
allEditsDueToRebasepublic boolean allEditsDueToRebase()A boolean indicating if all underlying edits of the file diff are due to rebase.
- 
insertionspublic int insertions()Returns the number of inserted lines for the file diff.
- 
deletionspublic int deletions()Returns the number of deleted lines for the file diff.
- 
emptypublic static FileDiffOutput empty(String filePath, org.eclipse.jgit.lib.ObjectId oldCommitId, org.eclipse.jgit.lib.ObjectId newCommitId) Returns an entity representing an unchanged file between two commits.
- 
createNegativepublic static FileDiffOutput createNegative(String filePath, org.eclipse.jgit.lib.ObjectId oldCommitId, org.eclipse.jgit.lib.ObjectId newCommitId) Create a negative file diff. We use this to cache negative diffs for entries that result in timeouts.
- 
isEmptypublic boolean isEmpty()Returns true if this entity represents an unchanged file between two commits.
- 
isNegativepublic boolean isNegative()Returnstrueif the diff computation was not able to compute a diff. We cache negative result in this case.
- 
builder
- 
weightpublic int weight()
 
-