T
- The type of the compared elements in the 'lines'.public final class Patch<T> extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
ConflictOutput<T> |
CONFLICT_PRODUCES_EXCEPTION
Standard Patch behaviour to throw an exception for pathching conflicts.
|
static ConflictOutput<String> |
CONFLICT_PRODUCES_MERGE_CONFLICT
Git like merge conflict output.
|
Modifier and Type | Method and Description |
---|---|
void |
addDelta(AbstractDelta<T> delta)
Add the given delta to this patch
|
List<T> |
applyTo(List<T> target)
Apply this patch to the given target
|
static <T> Patch<T> |
generate(List<T> original,
List<T> revised,
List<Change> changes) |
static <T> Patch<T> |
generate(List<T> original,
List<T> revised,
List<Change> _changes,
boolean includeEquals) |
List<AbstractDelta<T>> |
getDeltas()
Get the list of computed deltas
|
List<T> |
restore(List<T> target)
Restore the text to original.
|
String |
toString() |
Patch |
withConflictOutput(ConflictOutput<T> conflictOutput)
Alter normal conflict output behaviour to e.g. inclide some conflict
statements in the result, like git does it.
|
public final ConflictOutput<T> CONFLICT_PRODUCES_EXCEPTION
public static final ConflictOutput<String> CONFLICT_PRODUCES_MERGE_CONFLICT
public List<T> applyTo(List<T> target) throws PatchFailedException
PatchFailedException
- if can't apply patchpublic Patch withConflictOutput(ConflictOutput<T> conflictOutput)
public List<T> restore(List<T> target)
target
- the given targetpublic void addDelta(AbstractDelta<T> delta)
delta
- the given deltapublic List<AbstractDelta<T>> getDeltas()
public static <T> Patch<T> generate(List<T> original, List<T> revised, List<Change> changes)
Copyright © 2009–2021 java-diff-utils. All rights reserved.