Package org.apache.commons.lang3.builder
Class Diff<T>
- java.lang.Object
-
- org.apache.commons.lang3.tuple.Pair<T,T>
-
- org.apache.commons.lang3.builder.Diff<T>
-
- Type Parameters:
T
- The type of object contained within thisDiff
. Differences between primitive objects are stored as their Object wrapper equivalent.
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Pair<T,T>>
,java.util.Map.Entry<T,T>
public abstract class Diff<T> extends Pair<T,T>
ADiff
contains the differences between twoDiffable
class fields.Typically,
Diff
s are retrieved by using aDiffBuilder
to produce aDiffResult
, containing the differences between two objects.- Since:
- 3.3
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
fieldName
The field name.private static long
serialVersionUID
private java.lang.reflect.Type
type
The field type.-
Fields inherited from class org.apache.commons.lang3.tuple.Pair
EMPTY_ARRAY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getFieldName()
Gets the name of the field.java.lang.reflect.Type
getType()
Gets the type of the field.T
setValue(T value)
ThrowsUnsupportedOperationException
.java.lang.String
toString()
Returns aString
representation of theDiff
, with the following format:
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
type
private final java.lang.reflect.Type type
The field type.
-
fieldName
private final java.lang.String fieldName
The field name.
-
-
Constructor Detail
-
Diff
protected Diff(java.lang.String fieldName)
Constructs a newDiff
for the given field name.- Parameters:
fieldName
- the field name
-
-
Method Detail
-
getFieldName
public final java.lang.String getFieldName()
Gets the name of the field.- Returns:
- the field name
-
getType
public final java.lang.reflect.Type getType()
Gets the type of the field.- Returns:
- the field type
-
setValue
public final T setValue(T value)
ThrowsUnsupportedOperationException
.- Parameters:
value
- ignored- Returns:
- nothing
-
-