Package org.assertj.core.util.diff
Class ChangeDelta<T>
java.lang.Object
org.assertj.core.util.diff.Delta<T>
org.assertj.core.util.diff.ChangeDelta<T>
- Type Parameters:
T- The type of the compared elements in the 'lines'.
Initially copied from https://code.google.com/p/java-diff-utils/.
Describes the change-delta between original and revised texts.
- Author:
- Dmitry Naumenko
-
Nested Class Summary
Nested classes/interfaces inherited from class org.assertj.core.util.diff.Delta
Delta.TYPE -
Field Summary
Fields inherited from class org.assertj.core.util.diff.Delta
DEFAULT_END, DEFAULT_START -
Constructor Summary
ConstructorsConstructorDescriptionChangeDelta(Chunk<T> original, Chunk<T> revised) Creates a change delta with the two given chunks. -
Method Summary
Methods inherited from class org.assertj.core.util.diff.Delta
equals, getOriginal, getRevised, hashCode, lineNumber, toString
-
Constructor Details
-
ChangeDelta
Creates a change delta with the two given chunks.- Parameters:
original- The original chunk. Must not benull.revised- The original chunk. Must not benull.
-
-
Method Details
-
applyTo
Applies this delta as the patch for a given target- Specified by:
applyToin classDelta<T>- Parameters:
target- the given target- Throws:
IllegalStateException- ifDelta.verify(List)fails
-
verify
Verifies that this delta can be used to patch the given text.- Specified by:
verifyin classDelta<T>- Parameters:
target- the text to patch.- Throws:
IllegalStateException- if the patch cannot be applied.
-
getType
Description copied from class:DeltaReturns the type of delta
-