Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit05b5d80

Browse files
committed
1 parentd2355a8 commit05b5d80

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

‎src/main/java/com/github/difflib/unifieddiff/UnifiedDiff.java‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @author Tobias Warneke (t.warneke@gmx.net)
2525
*/
26-
publicclassUnifiedDiff {
26+
publicfinalclassUnifiedDiff {
2727

2828
privateStringheader;
2929
privateStringtail;
@@ -52,4 +52,14 @@ void setTailTxt(String tailTxt) {
5252
publicStringgetTail() {
5353
returntail;
5454
}
55+
56+
publicstaticUnifiedDifffrom(Stringheader,Stringtail,UnifiedDiffFile...files) {
57+
UnifiedDiffdiff =newUnifiedDiff();
58+
diff.setHeader(header);
59+
diff.setTailTxt(tail);
60+
for (UnifiedDiffFilefile :files) {
61+
diff.addFile(file);
62+
}
63+
returndiff;
64+
}
5565
}

‎src/main/java/com/github/difflib/unifieddiff/UnifiedDiffFile.java‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @author Tobias Warneke (t.warneke@gmx.net)
2323
*/
24-
publicclassUnifiedDiffFile {
24+
publicfinalclassUnifiedDiffFile {
2525

2626
privateStringdiffCommand;
2727
privateStringfromFile;
@@ -64,4 +64,12 @@ public String getIndex() {
6464
publicPatch<String>getPatch() {
6565
returnpatch;
6666
}
67+
68+
publicstaticUnifiedDiffFilefrom(StringfromFile,StringtoFile,Patch<String>patch) {
69+
UnifiedDiffFilefile =newUnifiedDiffFile();
70+
file.setFromFile(fromFile);
71+
file.setToFile(toFile);
72+
file.patch =patch;
73+
returnfile;
74+
}
6775
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp