Package org.alfresco.util.schemacomp
Interface ComparisonUtils
-
- All Known Implementing Classes:
DefaultComparisonUtils
public interface ComparisonUtilsUtilities for comparing data structures in the context of comparing two database schemas.- Author:
- Matt Ward
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcompareCollections(java.util.Collection<? extends DbObject> leftCollection, java.util.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.java.util.List<DbObject>findEquivalentObjects(DbObject rootObject, DbObject objToMatch)
-
-
-
Method Detail
-
findEquivalentObjects
java.util.List<DbObject> findEquivalentObjects(DbObject rootObject, DbObject objToMatch)
-
compareSimpleOrderedLists
void compareSimpleOrderedLists(DbProperty leftProperty, DbProperty rightProperty, DiffContext ctx)
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
void compareSimpleCollections(DbProperty leftProperty, DbProperty rightProperty, DiffContext ctx)
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(java.util.Collection<? extends DbObject> leftCollection, java.util.Collection<? extends DbObject> rightCollection, DiffContext ctx)
Compare collections ofDbObjects using theirDbObject.diff(DbObject, DiffContext)method.- Parameters:
ctx- - context
-
compareSimple
void compareSimple(DbProperty left, DbProperty right, DiffContext ctx)
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
-
-