Package com.github.difflib
Class UnifiedDiffUtils
- java.lang.Object
-
- com.github.difflib.UnifiedDiffUtils
-
public final class UnifiedDiffUtils extends Object
- Author:
- toben
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>generateUnifiedDiff(String originalFileName, String revisedFileName, List<String> originalLines, Patch<String> patch, int contextSize)generateUnifiedDiff takes a Patch and some other arguments, returning the Unified Diff format text representing the Patch.static Patch<String>parseUnifiedDiff(List<String> diff)Parse the given text in unified format and creates the list of deltas for it.
-
-
-
Method Detail
-
parseUnifiedDiff
public static Patch<String> parseUnifiedDiff(List<String> diff)
Parse the given text in unified format and creates the list of deltas for it.- Parameters:
diff- the text in unified format- Returns:
- the patch with deltas.
-
generateUnifiedDiff
public static List<String> generateUnifiedDiff(String originalFileName, String revisedFileName, List<String> originalLines, Patch<String> patch, int contextSize)
generateUnifiedDiff takes a Patch and some other arguments, returning the Unified Diff format text representing the Patch. Author: Bill James (tankerbay@gmail.com).- Parameters:
originalFileName- - Filename of the original (unrevised file)revisedFileName- - Filename of the revised fileoriginalLines- - Lines of the original filepatch- - Patch created by the diff() functioncontextSize- - number of lines of context output around each difference in the file.- Returns:
- List of strings representing the Unified Diff representation of the Patch argument.
-
-