Package org.alfresco.util.schemacomp
Class DefaultComparisonUtils
- java.lang.Object
-
- org.alfresco.util.schemacomp.DefaultComparisonUtils
-
- All Implemented Interfaces:
ComparisonUtils
public class DefaultComparisonUtils extends java.lang.Object implements ComparisonUtils
A collection of utility methods for determining differences between two database schemas.- Author:
- Matt Ward
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultComparisonUtils.EquivalentObjectSeeker
-
Constructor Summary
Constructors Constructor Description DefaultComparisonUtils()
-
Method Summary
All Methods Instance Methods Concrete 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 leftProperty, DbProperty rightProperty, DiffContext ctx)Compare two 'simple' (i.e.voidcompareSimpleCollections(DbProperty leftProp, DbProperty rightProp, DiffContext ctx)Compare two collections.voidcompareSimpleOrderedLists(DbProperty refProp, DbProperty targetProp, DiffContext ctx)Compare twoLists of 'simple' (i.e.java.util.List<DbObject>findEquivalentObjects(DbObject rootObject, DbObject objToMatch)
-
-
-
Method Detail
-
findEquivalentObjects
public java.util.List<DbObject> findEquivalentObjects(DbObject rootObject, DbObject objToMatch)
- Specified by:
findEquivalentObjectsin interfaceComparisonUtils
-
compareSimpleOrderedLists
public void compareSimpleOrderedLists(DbProperty refProp, DbProperty targetProp, DiffContext ctx)
Description copied from interface:ComparisonUtilsCompare 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.- Specified by:
compareSimpleOrderedListsin interfaceComparisonUtils- Parameters:
refProp- DbPropertytargetProp- DbPropertyctx- DiffContext
-
compareSimpleCollections
public void compareSimpleCollections(DbProperty leftProp, DbProperty rightProp, DiffContext ctx)
Description copied from interface:ComparisonUtilsCompare two collections. Similar toComparisonUtils.compareSimpleOrderedLists(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.- Specified by:
compareSimpleCollectionsin interfaceComparisonUtils- Parameters:
leftProp- DbPropertyrightProp- DbPropertyctx- - context
-
compareCollections
public void compareCollections(java.util.Collection<? extends DbObject> leftCollection, java.util.Collection<? extends DbObject> rightCollection, DiffContext ctx)
Description copied from interface:ComparisonUtilsCompare collections ofDbObjects using theirDbObject.diff(DbObject, DiffContext)method.- Specified by:
compareCollectionsin interfaceComparisonUtilsctx- - context
-
compareSimple
public void compareSimple(DbProperty leftProperty, DbProperty rightProperty, DiffContext ctx)
Description copied from interface:ComparisonUtilsCompare two 'simple' (i.e. non-DbObject) objects using theirObject.equals(Object)method to decide if there is a difference.- Specified by:
compareSimplein interfaceComparisonUtils- Parameters:
leftProperty- DbPropertyrightProperty- DbPropertyctx- - context
-
-