Package org.assertj.core.util.diff
Class Delta<T>
- java.lang.Object
-
- org.assertj.core.util.diff.Delta<T>
-
- Type Parameters:
T
- The type of the compared elements in the 'lines'.
- Direct Known Subclasses:
ChangeDelta
,DeleteDelta
,InsertDelta
public abstract class Delta<T> extends java.lang.Object
Initially copied from https://code.google.com/p/java-diff-utils/.Describes the delta between original and revised texts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Delta.TYPE
Specifies the type of the delta.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_END
static java.lang.String
DEFAULT_START
private Chunk<T>
original
The original chunk.private Chunk<T>
revised
The revised chunk.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
applyTo(java.util.List<T> target)
Applies this delta as the patch for a given targetboolean
equals(java.lang.Object obj)
(package private) java.lang.String
formatLines(java.util.List<T> lines)
Chunk<T>
getOriginal()
Chunk<T>
getRevised()
abstract Delta.TYPE
getType()
Returns the type of deltaint
hashCode()
(package private) int
lineNumber()
abstract void
verify(java.util.List<T> target)
Verifies that this delta can be used to patch the given text.
-
-
-
Field Detail
-
DEFAULT_END
public static final java.lang.String DEFAULT_END
- See Also:
- Constant Field Values
-
DEFAULT_START
public static final java.lang.String DEFAULT_START
- See Also:
- Constant Field Values
-
-
Method Detail
-
verify
public abstract void verify(java.util.List<T> target) throws java.lang.IllegalStateException
Verifies that this delta can be used to patch the given text.- Parameters:
target
- the text to patch.- Throws:
java.lang.IllegalStateException
- if the patch cannot be applied.
-
applyTo
public abstract void applyTo(java.util.List<T> target) throws java.lang.IllegalStateException
Applies this delta as the patch for a given target- Parameters:
target
- the given target- Throws:
java.lang.IllegalStateException
-
getType
public abstract Delta.TYPE getType()
Returns the type of delta- Returns:
- the type enum
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
lineNumber
int lineNumber()
-
formatLines
java.lang.String formatLines(java.util.List<T> lines)
-
-