Top Description Fields Constructors Methods
org.assertj.core.util.diff

public Class Patch<T>

extends Object
Class Inheritance
Type Parameters
<T>
The type of the compared elements in the 'lines'.
Imports
java.util.Collections, .LinkedList, .List, .ListIterator

Copy from https://code.google.com/p/java-diff-utils/.

Describes the patch holding all deltas between the original and revised texts.

Author
Dmitry Naumenko

Field Summary

Modifier and TypeField and Description
private List<Delta<T>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addDelta(Delta<T>
the given delta
delta
)

Add the given delta to this patch

public List<T>

Returns:

the patched text
applyTo
(List<T>
the list to patch
target
)

Apply this patch to the given target

public List<Delta<T>>

Returns:

the deltas
getDeltas
()

Get the list of computed deltas

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deltasback to summary
private List<Delta<T>> deltas

Constructor Detail

Patchback to summary
public Patch()

Method Detail

addDeltaback to summary
public void addDelta(Delta<T> delta)

Add the given delta to this patch

Parameters
delta:Delta<T>

the given delta

applyToback to summary
public List<T> applyTo(List<T> target) throws IllegalStateException

Apply this patch to the given target

Parameters
target:List<T>

the list to patch

Returns:List<T>

the patched text

Exceptions
IllegalStateException:
if can't apply patch
getDeltasback to summary
public List<Delta<T>> getDeltas()

Get the list of computed deltas

Returns:List<Delta<T>>

the deltas