Package org.assertj.core.util.diff
Class DeleteDelta<T>
- java.lang.Object
-
- org.assertj.core.util.diff.Delta<T>
-
- org.assertj.core.util.diff.DeleteDelta<T>
-
- Type Parameters:
T
- The type of the compared elements in the 'lines'.
public class DeleteDelta<T> extends Delta<T>
Initially copied from https://code.google.com/p/java-diff-utils/.Describes the delete-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
Constructors Constructor Description DeleteDelta(Chunk<T> original, Chunk<T> revised)
Creates a change delta with the two given chunks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyTo(List<T> target)
Applies this delta as the patch for a given targetDelta.TYPE
getType()
Returns the type of deltavoid
verify(List<T> target)
Verifies that this delta can be used to patch the given text.-
Methods inherited from class org.assertj.core.util.diff.Delta
equals, getOriginal, getRevised, hashCode, lineNumber, toString
-
-
-
-
Method Detail
-
applyTo
public void applyTo(List<T> target) throws IllegalStateException
Applies this delta as the patch for a given target- Specified by:
applyTo
in classDelta<T>
- Parameters:
target
- the given target- Throws:
IllegalStateException
- ifDelta.verify(List)
fails
-
getType
public Delta.TYPE getType()
Description copied from class:Delta
Returns the type of delta
-
verify
public void verify(List<T> target) throws IllegalStateException
Description copied from class:Delta
Verifies that this delta can be used to patch the given text.- Specified by:
verify
in classDelta<T>
- Parameters:
target
- the text to patch.- Throws:
IllegalStateException
- if the patch cannot be applied.
-
-