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:
Serializable, Comparable<Pair<T,T>>, Map.Entry<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.
- Since:
- 3.3
- See Also:
-
Field Summary
Fields inherited from class Pair
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Pair
accept, apply, compareTo, emptyArray, equals, getKey, getLeft, getRight, getValue, hashCode, of, of, ofNonNull, toStringModifier and TypeMethodDescription<E extends Throwable>
voidaccept(FailableBiConsumer<T, T, E> consumer) Accepts this key and value as arguments to the given consumer.<V, E extends Throwable>
Vapply(FailableBiFunction<T, T, V, E> function) Applies this key and value as arguments to the given function.intCompares the pair based on the left element followed by the right element.static <L,R> Pair<L, R>[] Returns the empty array singleton that can be assigned without compiler warning.booleanCompares this pair to another based on the two elements.final TgetKey()Gets the key from this pair.abstract TgetLeft()Gets the left element from this pair.abstract TgetRight()Gets the right element from this pair.getValue()Gets the value from this pair.inthashCode()Returns a suitable hash code.static <L,R> Pair <L, R> Creates an immutable pair from a map entry.static <L,R> Pair <L, R> of(L left, R right) Creates an immutable pair of two objects inferring the generic types.static <L,R> Pair <L, R> ofNonNull(L left, R right) Creates an immutable pair of two non-null objects inferring the generic types.Formats the receiver using the given format.
-
Constructor Details
-
Diff
-
-
Method Details
-
getFieldName
-
getType
Deprecated.Unused, will be removed in 4.0.0.Gets the type of the field.- Returns:
- The field type.
-
setValue
Sets no value and always throwsUnsupportedOperationException.- Parameters:
value- ignored.- Returns:
- Throws
UnsupportedOperationException.
-
toString
-