org.sdnplatform.sync.internal.version
Class ChainedResolver<T>
java.lang.Object
org.sdnplatform.sync.internal.version.ChainedResolver<T>
- All Implemented Interfaces:
- IInconsistencyResolver<T>
public class ChainedResolver<T>
- extends java.lang.Object
- implements IInconsistencyResolver<T>
Apply the given inconsistency resolvers in order until there are 1 or fewer
items left.
Method Summary |
boolean |
equals(java.lang.Object o)
|
int |
hashCode()
|
java.util.List<T> |
resolveConflicts(java.util.List<T> items)
Take two different versions of an object and combine them into a single
version of the object Implementations must maintain the contract that
resolveConflict([null, null]) == null
if t != null , then
resolveConflict([null, t]) == resolveConflict([t, null]) == t |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
ChainedResolver
public ChainedResolver(IInconsistencyResolver<T>... resolvers)
resolveConflicts
public java.util.List<T> resolveConflicts(java.util.List<T> items)
- Description copied from interface:
IInconsistencyResolver
- Take two different versions of an object and combine them into a single
version of the object Implementations must maintain the contract that
-
resolveConflict([null, null]) == null
-
if
t != null
, then
resolveConflict([null, t]) == resolveConflict([t, null]) == t
- Specified by:
resolveConflicts
in interface IInconsistencyResolver<T>
- Parameters:
items
- The items to be resolved
- Returns:
- The united object
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object