T - The type of object contained within this Diff. Differences
between primitive objects are stored as their Object wrapper
equivalent.public abstract class Diff<T> extends Pair<T,T>
A Diff contains the differences between two Diffable class
fields.
Typically, Diffs are retrieved by using a DiffBuilder to
produce a DiffResult, containing the differences between two objects.
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
fieldName |
private static long |
serialVersionUID |
private java.lang.reflect.Type |
type |
| Modifier | Constructor and Description |
|---|---|
protected |
Diff(java.lang.String fieldName)
Constructs a new
Diff for the given field name. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFieldName()
Returns the name of the field.
|
java.lang.reflect.Type |
getType()
Returns the type of the field.
|
T |
setValue(T value)
Throws
UnsupportedOperationException. |
java.lang.String |
toString()
Returns a
String representation of the Diff, with the
following format: |
compareTo, equals, getKey, getLeft, getRight, getValue, hashCode, of, toStringprivate static final long serialVersionUID
private final java.lang.reflect.Type type
private final java.lang.String fieldName
protected Diff(java.lang.String fieldName)
Constructs a new Diff for the given field name.
fieldName - the name of the fieldpublic final java.lang.reflect.Type getType()
Returns the type of the field.
public final java.lang.String getFieldName()
Returns the name of the field.
public final java.lang.String toString()
Returns a String representation of the Diff, with the
following format:
[fieldname: left-value, right-value]