Package org.alfresco.util.schemacomp
Interface ComparisonUtils
- All Known Implementing Classes:
DefaultComparisonUtils
public interface ComparisonUtils
Utilities for comparing data structures in the context of comparing two database schemas.
- Author:
- Matt Ward
-
Method Summary
Modifier and TypeMethodDescriptionvoidcompareCollections(Collection<? extends DbObject> leftCollection, Collection<? extends DbObject> rightCollection, DiffContext ctx) Compare collections ofDbObjects using theirDbObject.diff(DbObject, DiffContext)method.voidcompareSimple(DbProperty left, DbProperty right, DiffContext ctx) Compare two 'simple' (i.e.voidcompareSimpleCollections(DbProperty leftProperty, DbProperty rightProperty, DiffContext ctx) Compare two collections.voidcompareSimpleOrderedLists(DbProperty leftProperty, DbProperty rightProperty, DiffContext ctx) Compare twoLists of 'simple' (i.e.findEquivalentObjects(DbObject rootObject, DbObject objToMatch)
-
Method Details
-
findEquivalentObjects
-
compareSimpleOrderedLists
Compare twoLists of 'simple' (i.e. non-DbObject) objects. Ordering is significant - if an element E appears in both collections but at different indexes then it is not considered to be the same item.- Parameters:
leftProperty- DbPropertyrightProperty- DbPropertyctx- DiffContext
-
compareSimpleCollections
Compare two collections. Similar tocompareSimpleOrderedLists(DbProperty, DbProperty, DiffContext)except that this method operates onCollections and order (and cardinality) is not important. If an element E from the reference collection appears one or more times at any position in the target collection then that element is said to bein both with no difference.- Parameters:
leftProperty- DbPropertyrightProperty- DbPropertyctx- - context
-
compareCollections
void compareCollections(Collection<? extends DbObject> leftCollection, Collection<? extends DbObject> rightCollection, DiffContext ctx) Compare collections ofDbObjects using theirDbObject.diff(DbObject, DiffContext)method.- Parameters:
ctx- - context
-
compareSimple
Compare two 'simple' (i.e. non-DbObject) objects using theirObject.equals(Object)method to decide if there is a difference.- Parameters:
left- DbPropertyright- DbPropertyctx- - context
-