Package com.google.gerrit.entities
Class Patch
- java.lang.Object
-
- com.google.gerrit.entities.Patch
-
public final class Patch extends Object
Wrapper class for patch related aspects. Originally, this class represented a single modified file in aPatchSet
. It's only kept in its current form asPatch.ChangeType
andPatch.PatchType
are used in diff cache entries for which we would break the serialization if we moved the enums somewhere else.
-
-
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.FileMode
Constants describing various file modes recognized by GIT.static class
Patch.Key
static class
Patch.PatchType
Type of formatting for this patch.
-
Field Summary
Fields Modifier and Type Field Description static String
COMMIT_MSG
Magical file name which represents the commit message.static String
MERGE_LIST
Magical file name which represents the merge list of a merge commit.static String
PATCHSET_LEVEL
Magical file name which doesn't represent a file.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isMagic(String path)
Checks if the given path represents a magic file.static Patch.Key
key(PatchSet.Id patchSetId, String fileName)
-
-
-
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
-
PATCHSET_LEVEL
public static final String PATCHSET_LEVEL
Magical file name which doesn't represent a file. Used specifically for patchset-level comments.- See Also:
- Constant Field Values
-
-
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)
-
-