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>
A
Diffcontains the differences between twoDiffableclass fields.Typically,
Diffs are retrieved by using aDiffBuilderto produce aDiffResult, containing the differences between two objects.- Since:
- 3.3
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.commons.lang3.tuple.Pair
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDiff(java.lang.String fieldName)Constructs a newDifffor the given field name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFieldName()Returns the name of the field.java.lang.reflect.TypegetType()Returns the type of the field.TsetValue(T value)ThrowsUnsupportedOperationException.java.lang.StringtoString()Returns aStringrepresentation of theDiff, with the following format:
-
-
-
Method Detail
-
getType
public final java.lang.reflect.Type getType()
Returns the type of the field.
- Returns:
- the field type
-
getFieldName
public final java.lang.String getFieldName()
Returns the name of the field.
- Returns:
- the field name
-
toString
public final java.lang.String toString()
Returns a
Stringrepresentation of theDiff, with the following format:[fieldname: left-value, right-value]
-
-