Package com.google.gerrit.entities
Class Patch
- java.lang.Object
-
- com.google.gerrit.entities.Patch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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.
-
Field Summary
Fields Modifier and Type Field Description protected char
changeType
What sort of change is this to the path; seePatch.ChangeType
.static 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 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; seePatch.PatchType
.protected String
sourceFileName
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Patch.ChangeType
getChangeType()
int
getCommentCount()
int
getDeletions()
int
getDraftCount()
String
getFileName()
int
getInsertions()
Patch.Key
getKey()
Patch.PatchType
getPatchType()
String
getSourceFileName()
static boolean
isMagic(String path)
Checks if the given path represents a magic file.boolean
isReviewedByCurrentUser()
static Patch.Key
key(PatchSet.Id patchSetId, 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(String n)
String
toString()
-
-
-
Field Detail
-
COMMIT_MSG
public static final String COMMIT_MSG
Magical file name which represents the commit message.- See Also:
- Constant Field Values
-
MERGE_LIST
public static final String MERGE_LIST
Magical file name which represents the merge list of a merge commit.- See Also:
- Constant Field Values
-
key
protected Patch.Key key
-
changeType
protected char changeType
What sort of change is this to the path; seePatch.ChangeType
.
-
patchType
protected char patchType
What type of patch is this; seePatch.PatchType
.
-
nbrComments
protected int nbrComments
Number of published comments on this patch.
-
nbrDrafts
protected int nbrDrafts
Number of drafts by the current user; not persisted in the datastore.
-
insertions
protected int insertions
Number of lines added to the file.
-
deletions
protected int deletions
Number of lines deleted from the file.
-
sourceFileName
protected String sourceFileName
-
-
Constructor Detail
-
Patch
protected Patch()
-
Patch
public Patch(Patch.Key newId)
-
-
Method Detail
-
isMagic
public static boolean isMagic(String path)
Checks if the given path represents a magic file. A magic file is a generated file that is automatically included into changes. It does not exist in the commit of the patch set.- Parameters:
path
- the file path- Returns:
true
if the path represents a magic file, otherwisefalse
.
-
key
public static Patch.Key key(PatchSet.Id patchSetId, String fileName)
-
getKey
public Patch.Key getKey()
-
getCommentCount
public int getCommentCount()
-
setCommentCount
public void setCommentCount(int n)
-
getDraftCount
public int getDraftCount()
-
setDraftCount
public void setDraftCount(int n)
-
getInsertions
public int getInsertions()
-
setInsertions
public void setInsertions(int n)
-
getDeletions
public int getDeletions()
-
setDeletions
public void setDeletions(int n)
-
getChangeType
public Patch.ChangeType getChangeType()
-
setChangeType
public void setChangeType(Patch.ChangeType type)
-
getPatchType
public Patch.PatchType getPatchType()
-
setPatchType
public void setPatchType(Patch.PatchType type)
-
getFileName
public String getFileName()
-
getSourceFileName
public String getSourceFileName()
-
setSourceFileName
public void setSourceFileName(String n)
-
isReviewedByCurrentUser
public boolean isReviewedByCurrentUser()
-
setReviewedByCurrentUser
public void setReviewedByCurrentUser(boolean r)
-
-