Package com.google.gerrit.server.patch
Class PatchList
- java.lang.Object
-
- com.google.gerrit.server.patch.PatchList
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
PatchListCacheImpl.LargeObjectTombstone
public class PatchList extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PatchList(org.eclipse.jgit.lib.AnyObjectId oldId, org.eclipse.jgit.lib.AnyObjectId newId, boolean isMerge, ComparisonType comparisonType, PatchListEntry[] patches)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatchListEntry
get(String fileName)
Find an entry by name, returning an empty entry if not present.ComparisonType
getComparisonType()
int
getDeletions()
int
getInsertions()
org.eclipse.jgit.lib.ObjectId
getNewId()
New side commit.org.eclipse.jgit.lib.ObjectId
getOldId()
Old side tree or commit; null only if this is a combined diff.List<PatchListEntry>
getPatches()
Get a sorted, unmodifiable list of all files in this list.List<Patch>
toPatchList(PatchSet.Id setId)
Get a sorted, modifiable list of all files in this list.
-
-
-
Constructor Detail
-
PatchList
public PatchList(org.eclipse.jgit.lib.AnyObjectId oldId, org.eclipse.jgit.lib.AnyObjectId newId, boolean isMerge, ComparisonType comparisonType, PatchListEntry[] patches)
-
-
Method Detail
-
getOldId
public org.eclipse.jgit.lib.ObjectId getOldId()
Old side tree or commit; null only if this is a combined diff.
-
getNewId
public org.eclipse.jgit.lib.ObjectId getNewId()
New side commit.
-
getPatches
public List<PatchListEntry> getPatches()
Get a sorted, unmodifiable list of all files in this list.
-
getComparisonType
public ComparisonType getComparisonType()
- Returns:
- the comparison type
-
getInsertions
public int getInsertions()
- Returns:
- total number of new lines added.
-
getDeletions
public int getDeletions()
- Returns:
- total number of lines removed.
-
toPatchList
public List<Patch> toPatchList(PatchSet.Id setId)
Get a sorted, modifiable list of all files in this list.The returned list items do not populate:
- Parameters:
setId
- the patch set identity these patches belong to. This really should not need to be specified, but is a current legacy artifact of how the cache is keyed versus how the database is keyed.
-
get
public PatchListEntry get(String fileName)
Find an entry by name, returning an empty entry if not present.
-
-