public class Diffs extends Object
Constructor and Description |
---|
Diffs() |
Modifier and Type | Method and Description |
---|---|
static <E> ListDiff<E> |
computeLazyListDiff(List<? extends E> oldList,
List<? extends E> newList)
Returns a lazily computed
ListDiff describing the change between
the specified old and new list states. |
static <K,V> MapDiff<K,V> |
computeLazyMapDiff(Map<? extends K,? extends V> oldMap,
Map<? extends K,? extends V> newMap)
Returns a lazily computed
MapDiff describing the change between
the specified old and new map states. |
static <E> SetDiff<E> |
computeLazySetDiff(Set<? extends E> oldSet,
Set<? extends E> newSet)
Returns a lazily computed
SetDiff describing the change between
the specified old and new set states. |
static <E> ListDiff<E> |
computeListDiff(List<? extends E> oldList,
List<? extends E> newList)
Returns a
ListDiff describing the change between the specified
old and new list states. |
static <K,V> MapDiff<K,V> |
computeMapDiff(Map<? extends K,? extends V> oldMap,
Map<? extends K,? extends V> newMap)
Returns a
MapDiff describing the change between the specified old
and new map states. |
static <E> SetDiff<E> |
computeSetDiff(Set<? extends E> oldSet,
Set<? extends E> newSet)
Returns a
SetDiff describing the change between the specified old
and new set states. |
static <E> ListDiff<E> |
createListDiff(List<ListDiffEntry<E>> differences)
Creates a new ListDiff object given its constituent ListDiffEntry
objects.
|
static <E> ListDiff<E> |
createListDiff(ListDiffEntry<E> difference) |
static <E> ListDiff<E> |
createListDiff(ListDiffEntry<E>[] differences)
Creates a new ListDiff object given its constituent ListDiffEntry
objects.
|
static <E> ListDiff<E> |
createListDiff(ListDiffEntry<E> difference1,
ListDiffEntry<E> difference2) |
static <E> ListDiffEntry<E> |
createListDiffEntry(int position,
boolean isAddition,
E element) |
static <K,V> MapDiff<K,V> |
createMapDiff(Set<? extends K> addedKeys,
Set<? extends K> removedKeys,
Set<? extends K> changedKeys,
Map<? extends K,? extends V> oldValues,
Map<? extends K,? extends V> newValues) |
static <K,V> MapDiff<K,V> |
createMapDiffRemoveAll(Map<K,V> copyOfOldMap) |
static <K,V> MapDiff<K,V> |
createMapDiffSingleAdd(K addedKey,
V newValue)
Creates a MapDiff representing the addition of a single added key
|
static <K,V> MapDiff<K,V> |
createMapDiffSingleChange(K existingKey,
V oldValue,
V newValue) |
static <K,V> MapDiff<K,V> |
createMapDiffSingleRemove(K removedKey,
V oldValue) |
static <E> SetDiff<E> |
createSetDiff(Set<? extends E> additions,
Set<? extends E> removals) |
static <T> ValueDiff<T> |
createValueDiff(T oldValue,
T newValue)
Creates a diff between two values
|
static boolean |
equals(Object left,
Object right)
Checks whether the two objects are
null -- allowing for
null . |
static <E> ListDiff<E> |
unmodifiableDiff(ListDiff<? extends E> diff)
Returns an unmodifiable wrapper on top of the given diff.
|
static <K,V> MapDiff<K,V> |
unmodifiableDiff(MapDiff<? extends K,? extends V> diff)
Returns an unmodifiable wrapper on top of the given diff.
|
static <E> SetDiff<E> |
unmodifiableDiff(SetDiff<? extends E> diff)
Returns an unmodifiable wrapper on top of the given diff.
|
static <V> ValueDiff<V> |
unmodifiableDiff(ValueDiff<? extends V> diff)
Returns an unmodifiable wrapper on top of the given diff.
|
public static <E> ListDiff<E> unmodifiableDiff(ListDiff<? extends E> diff)
ListDiff<? extends E>
into a
ListDiff<E>
.diff
- the diff to convertpublic static <E> SetDiff<E> unmodifiableDiff(SetDiff<? extends E> diff)
SetDiff<? extends E>
into a
SetDiff<E>
.diff
- the diff to convertpublic static <K,V> MapDiff<K,V> unmodifiableDiff(MapDiff<? extends K,? extends V> diff)
MapDiff<? extends K, ? extends V>
into a MapDiff<K,V>
.diff
- the diff to convertpublic static <V> ValueDiff<V> unmodifiableDiff(ValueDiff<? extends V> diff)
ValueDiff<? extends V>
into a
ValueDiff<V>
.diff
- the diff to convertpublic static <E> ListDiff<E> computeListDiff(List<? extends E> oldList, List<? extends E> newList)
ListDiff
describing the change between the specified
old and new list states.E
- the list element typeoldList
- the old list statenewList
- the new list statepublic static <E> ListDiff<E> computeLazyListDiff(List<? extends E> oldList, List<? extends E> newList)
ListDiff
describing the change between
the specified old and new list states.E
- the list element typeoldList
- the old list statenewList
- the new list stateListDiff
describing the change between
the specified old and new list states.public static final boolean equals(Object left, Object right)
null
-- allowing for
null
.left
- The left object to compare; may be null
.right
- The right object to compare; may be null
.true
if the two objects are equivalent;
false
otherwise.public static <E> SetDiff<E> computeSetDiff(Set<? extends E> oldSet, Set<? extends E> newSet)
SetDiff
describing the change between the specified old
and new set states.E
- the set element typeoldSet
- the old set statenewSet
- the new set stateSetDiff
describing the change between the specified old
and new set states.public static <E> SetDiff<E> computeLazySetDiff(Set<? extends E> oldSet, Set<? extends E> newSet)
SetDiff
describing the change between
the specified old and new set states.E
- the set element typeoldSet
- the old set statenewSet
- the new set stateSetDiff
describing the change between
the specified old and new set states.public static <K,V> MapDiff<K,V> computeMapDiff(Map<? extends K,? extends V> oldMap, Map<? extends K,? extends V> newMap)
MapDiff
describing the change between the specified old
and new map states.K
- the type of keys maintained by this mapV
- the type of mapped valuesoldMap
- the old map statenewMap
- the new map stateMapDiff
describing the change between the specified old
and new map states.public static <K,V> MapDiff<K,V> computeLazyMapDiff(Map<? extends K,? extends V> oldMap, Map<? extends K,? extends V> newMap)
MapDiff
describing the change between
the specified old and new map states.K
- the type of keys maintained by this mapV
- the type of mapped valuesoldMap
- the old map statenewMap
- the new map stateMapDiff
describing the change between
the specified old and new map states.public static <T> ValueDiff<T> createValueDiff(T oldValue, T newValue)
T
- the value typeoldValue
- newValue
- public static <E> SetDiff<E> createSetDiff(Set<? extends E> additions, Set<? extends E> removals)
E
- the set element typeadditions
- removals
- public static <E> ListDiff<E> createListDiff(ListDiffEntry<E> difference)
E
- the list element typedifference
- public static <E> ListDiff<E> createListDiff(ListDiffEntry<E> difference1, ListDiffEntry<E> difference2)
E
- the list element typedifference1
- difference2
- public static <E> ListDiff<E> createListDiff(ListDiffEntry<E>[] differences)
This form cannot be used in a type-safe manner because it is not possible to construct an array of generic types in a type-safe manner. Use the form below which takes a properly parameterized List.
E
- the list element typedifferences
- public static <E> ListDiff<E> createListDiff(List<ListDiffEntry<E>> differences)
E
- the list element typedifferences
- public static <E> ListDiffEntry<E> createListDiffEntry(int position, boolean isAddition, E element)
E
- the list element typeposition
- isAddition
- element
- public static <K,V> MapDiff<K,V> createMapDiffSingleAdd(K addedKey, V newValue)
K
- the type of keys maintained by this mapV
- the type of mapped valuesaddedKey
- newValue
- public static <K,V> MapDiff<K,V> createMapDiffSingleChange(K existingKey, V oldValue, V newValue)
K
- the type of keys maintained by this mapV
- the type of mapped valuesexistingKey
- oldValue
- newValue
- public static <K,V> MapDiff<K,V> createMapDiffSingleRemove(K removedKey, V oldValue)
K
- the type of keys maintained by this mapV
- the type of mapped valuesremovedKey
- oldValue
- public static <K,V> MapDiff<K,V> createMapDiffRemoveAll(Map<K,V> copyOfOldMap)
K
- the type of keys maintained by this mapV
- the type of mapped valuescopyOfOldMap
- public static <K,V> MapDiff<K,V> createMapDiff(Set<? extends K> addedKeys, Set<? extends K> removedKeys, Set<? extends K> changedKeys, Map<? extends K,? extends V> oldValues, Map<? extends K,? extends V> newValues)
K
- the type of keys maintained by this mapV
- the type of mapped valuesaddedKeys
- removedKeys
- changedKeys
- oldValues
- newValues
-
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.