public final class Patch
extends java.lang.Object
PatchSet
.Modifier and Type | Class and Description |
---|---|
static class |
Patch.ChangeType
Type of modification made to the file path.
|
static class |
Patch.Key |
static class |
Patch.PatchType
Type of formatting for this patch.
|
Modifier and Type | Field and Description |
---|---|
protected char |
changeType
What sort of change is this to the path; see
Patch.ChangeType . |
static java.lang.String |
COMMIT_MSG
Magical file name which represents the commit message.
|
protected int |
deletions
Number of lines deleted from the file.
|
protected int |
insertions
Number of lines added to the file.
|
protected Patch.Key |
key |
static java.lang.String |
MERGE_LIST
Magical file name which represents the merge list of a merge commit.
|
protected int |
nbrComments
Number of published comments on this patch.
|
protected int |
nbrDrafts
Number of drafts by the current user; not persisted in the datastore.
|
protected char |
patchType
What type of patch is this; see
Patch.PatchType . |
protected java.lang.String |
sourceFileName
|
Modifier | Constructor and Description |
---|---|
protected |
Patch() |
|
Patch(Patch.Key newId) |
Modifier and Type | Method and Description |
---|---|
Patch.ChangeType |
getChangeType() |
int |
getCommentCount() |
int |
getDeletions() |
int |
getDraftCount() |
java.lang.String |
getFileName() |
int |
getInsertions() |
Patch.Key |
getKey() |
Patch.PatchType |
getPatchType() |
java.lang.String |
getSourceFileName() |
static boolean |
isMagic(java.lang.String path)
Checks if the given path represents a magic file.
|
boolean |
isReviewedByCurrentUser() |
static Patch.Key |
key(PatchSet.Id patchSetId,
java.lang.String fileName) |
void |
setChangeType(Patch.ChangeType type) |
void |
setCommentCount(int n) |
void |
setDeletions(int n) |
void |
setDraftCount(int n) |
void |
setInsertions(int n) |
void |
setPatchType(Patch.PatchType type) |
void |
setReviewedByCurrentUser(boolean r) |
void |
setSourceFileName(java.lang.String n) |
java.lang.String |
toString() |
public static final java.lang.String COMMIT_MSG
public static final java.lang.String MERGE_LIST
protected Patch.Key key
protected char changeType
Patch.ChangeType
.protected char patchType
Patch.PatchType
.protected int nbrComments
protected int nbrDrafts
protected int insertions
protected int deletions
protected java.lang.String sourceFileName
protected Patch()
public Patch(Patch.Key newId)
public static boolean isMagic(java.lang.String path)
path
- the file pathtrue
if the path represents a magic file, otherwise false
.public static Patch.Key key(PatchSet.Id patchSetId, java.lang.String fileName)
public Patch.Key getKey()
public int getCommentCount()
public void setCommentCount(int n)
public int getDraftCount()
public void setDraftCount(int n)
public int getInsertions()
public void setInsertions(int n)
public int getDeletions()
public void setDeletions(int n)
public Patch.ChangeType getChangeType()
public void setChangeType(Patch.ChangeType type)
public Patch.PatchType getPatchType()
public void setPatchType(Patch.PatchType type)
public java.lang.String getFileName()
public java.lang.String getSourceFileName()
public void setSourceFileName(java.lang.String n)
public boolean isReviewedByCurrentUser()
public void setReviewedByCurrentUser(boolean r)
public java.lang.String toString()
toString
in class java.lang.Object