Class Patch


  • public final class Patch
    extends Object
    A single modified file in a PatchSet.
    • 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
      • changeType

        protected char changeType
        What sort of change is this to the path; see Patch.ChangeType.
      • patchType

        protected char patchType
        What type of patch is this; see Patch.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.
    • Constructor Detail

      • Patch

        protected Patch()
    • 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, otherwise false.
      • 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)
      • getFileName

        public String getFileName()
      • getSourceFileName

        public String getSourceFileName()
      • setSourceFileName

        public void setSourceFileName​(String n)
      • isReviewedByCurrentUser

        public boolean isReviewedByCurrentUser()
      • setReviewedByCurrentUser

        public void setReviewedByCurrentUser​(boolean r)