Package com.google.gerrit.server.patch
Class GitPositionTransformer.FileMapping
java.lang.Object
com.google.gerrit.server.patch.GitPositionTransformer.FileMapping
- Enclosing class:
- GitPositionTransformer
A mapping of attributes from a file in one Git tree (source) to a file in another Git tree
 (target).
 
At the moment, only the file path is considered. Other attributes like file mode would be imaginable too but are currently not supported.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionforAddedFile(String filePath) Creates aGitPositionTransformer.FileMappingfor a file addition.forDeletedFile(String filePath) Creates aGitPositionTransformer.FileMappingfor a file deletion.Creates aGitPositionTransformer.FileMappingusing the old and new paths.forModifiedFile(String filePath) Creates aGitPositionTransformer.FileMappingfor a file modification.forRenamedFile(String oldPath, String newPath) Creates aGitPositionTransformer.FileMappingfor a file renaming.newPath()File path in the target tree.oldPath()File path in the source tree.
- 
Constructor Details- 
FileMappingpublic FileMapping()
 
- 
- 
Method Details- 
oldPathFile path in the source tree. For file additions, this is an emptyOptional.
- 
newPath
- 
forAddedFileCreates aGitPositionTransformer.FileMappingfor a file addition.In the context of GitPositionTransformer, file additions are irrelevant as no given position in the source tree can refer to such a new file in the target tree. We still provide this factory method so that code outside ofGitPositionTransformerdoesn't have to care about such details and can simply createGitPositionTransformer.FileMappings for any modifications between the trees.
- 
forDeletedFileCreates aGitPositionTransformer.FileMappingfor a file deletion.
- 
forModifiedFileCreates aGitPositionTransformer.FileMappingfor a file modification.
- 
forRenamedFileCreates aGitPositionTransformer.FileMappingfor a file renaming.
- 
forFilepublic static GitPositionTransformer.FileMapping forFile(Optional<String> oldPath, Optional<String> newPath) Creates aGitPositionTransformer.FileMappingusing the old and new paths.
 
-