Class ModifiedFile
- java.lang.Object
-
- com.google.gerrit.server.patch.gitdiff.ModifiedFile
-
public abstract class ModifiedFile extends Object
An entity representing a Modified file due to a diff between 2 git trees. This entity contains the change type and the old & new paths, but does not include any actual content diff of the file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModifiedFile.Builder
-
Constructor Summary
Constructors Constructor Description ModifiedFile()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ModifiedFile.Builder
builder()
abstract Patch.ChangeType
changeType()
Returns the change type (i.e.abstract Optional<String>
newPath()
Returns the new name associated with this file.abstract Optional<String>
oldPath()
Returns the old name associated with this file.abstract ModifiedFile.Builder
toBuilder()
int
weight()
Computes this object's weight, which is its size in bytes.
-
-
-
Method Detail
-
changeType
public abstract Patch.ChangeType changeType()
Returns the change type (i.e. add, delete, modify, rename, etc...) associated with this modified file.
-
oldPath
public abstract Optional<String> oldPath()
Returns the old name associated with this file. An empty optional is returned ifchangeType()
is equal toPatch.ChangeType.ADDED
.
-
newPath
public abstract Optional<String> newPath()
Returns the new name associated with this file. An empty optional is returned ifchangeType()
is equal toPatch.ChangeType.DELETED
-
builder
public static ModifiedFile.Builder builder()
-
toBuilder
public abstract ModifiedFile.Builder toBuilder()
-
weight
public int weight()
Computes this object's weight, which is its size in bytes.
-
-