T
- The type of the compared elements in the 'lines'.public final class Patch<T> extends Object implements Serializable
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() |
public List<T> applyTo(List<T> target) throws PatchFailedException
PatchFailedException
- if can't apply patchpublic 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–2020 java-diff-utils. All rights reserved.