Class GitFileDiff
java.lang.Object
com.google.gerrit.server.patch.gitfilediff.GitFileDiff
Entity representing a modified file (added, deleted, modified, renamed, etc...) between two
 different git commits.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic enum
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic GitFileDiff.Builderbuilder()abstract Patch.ChangeTypeThe change type associated with the file.abstract com.google.common.collect.ImmutableList<Edit>edits()AnImmutableListof the modified regions in the file.abstract StringA string representation of theFileHeader.booleanisEmpty()Returns true if the object was created using theempty(AbbreviatedObjectId, AbbreviatedObjectId, String)method.booleanReturnstrueif the diff computation was not able to compute a diff.negative()Returnstrueif the diff computation was not able to compute a diff.abstract org.eclipse.jgit.lib.AbbreviatedObjectIdnewId()The 20 bytes SHA-1 object ID of the new git tree of the diff.abstract Optional<Patch.FileMode>newMode()The file mode of the new file at the new git tree diff identified bynewId().newPath()The file name at the new git tree identified bynewId()abstract org.eclipse.jgit.lib.AbbreviatedObjectIdoldId()The 20 bytes SHA-1 object ID of the old git tree of the diff, orObjectId.zeroId()ifnewId()was a root git tree (i.e.abstract Optional<Patch.FileMode>oldMode()The file mode of the old file at the old git tree diff identified byoldId().oldPath()The file name at the old git tree identified byoldId()abstract Optional<Patch.PatchType>The patch type associated with the file.abstract GitFileDiff.Builderintweight()Returns the size of the object in bytes.
- 
Constructor Details- 
GitFileDiffpublic GitFileDiff()
 
- 
- 
Method Details- 
editsAnImmutableListof the modified regions in the file.
- 
fileHeaderA string representation of theFileHeader.
- 
oldPathThe file name at the old git tree identified byoldId()
- 
newPathThe file name at the new git tree identified bynewId()
- 
oldIdpublic abstract org.eclipse.jgit.lib.AbbreviatedObjectId oldId()The 20 bytes SHA-1 object ID of the old git tree of the diff, orObjectId.zeroId()ifnewId()was a root git tree (i.e. has no parents).
- 
newIdpublic abstract org.eclipse.jgit.lib.AbbreviatedObjectId newId()The 20 bytes SHA-1 object ID of the new git tree of the diff.
- 
oldModeThe file mode of the old file at the old git tree diff identified byoldId().
- 
newModeThe file mode of the new file at the new git tree diff identified bynewId().
- 
changeTypeThe change type associated with the file.
- 
patchTypeThe patch type associated with the file.
- 
negativeReturnstrueif the diff computation was not able to compute a diff. We cache negative result in this case.
- 
isEmptypublic boolean isEmpty()Returns true if the object was created using theempty(AbbreviatedObjectId, AbbreviatedObjectId, String)method.
- 
isNegativepublic boolean isNegative()Returnstrueif the diff computation was not able to compute a diff. We cache negative result in this case.
- 
weightpublic int weight()Returns the size of the object in bytes.
- 
getDefaultPath
- 
builder
- 
toBuilder
 
-