org.alfresco.util.schemacomp
Class DefaultComparisonUtils

java.lang.Object
  extended by 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.


Nested Class Summary
static class DefaultComparisonUtils.EquivalentObjectSeeker
           
 
Constructor Summary
DefaultComparisonUtils()
           
 
Method Summary
 void compareCollections(java.util.Collection leftCollection, java.util.Collection rightCollection, DiffContext ctx)
          Compare collections, reporting differences using the default Difference.Strength
 void compareCollections(java.util.Collection leftCollection, java.util.Collection rightCollection, DiffContext ctx, Result.Strength strength)
          Compare collections of DbObjects using their DbObject#diff(DbObject, Results) method.
 void compareSimple(DbProperty left, DbProperty right, DiffContext ctx)
          Compare two simple objects.
 void compareSimple(DbProperty leftProperty, DbProperty rightProperty, DiffContext ctx, Result.Strength strength)
          Compare two 'simple' (i.e.
 void compareSimpleCollections(DbProperty leftProp, DbProperty rightProp, DiffContext ctx, Result.Strength strength)
           
 java.util.List findEquivalentObjects(DbObject rootObject, DbObject objToMatch)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComparisonUtils

public DefaultComparisonUtils()
Method Detail

findEquivalentObjects

public java.util.List findEquivalentObjects(DbObject rootObject,
                                            DbObject objToMatch)
Specified by:
findEquivalentObjects in interface ComparisonUtils

compareSimpleCollections

public void compareSimpleCollections(DbProperty leftProp,
                                     DbProperty rightProp,
                                     DiffContext ctx,
                                     Result.Strength strength)
Specified by:
compareSimpleCollections in interface ComparisonUtils

compareCollections

public void compareCollections(java.util.Collection leftCollection,
                               java.util.Collection rightCollection,
                               DiffContext ctx)
Compare collections, reporting differences using the default Difference.Strength

Specified by:
compareCollections in interface ComparisonUtils
See Also:
#compareCollections(Collection, Collection, Results, Strength)

compareCollections

public void compareCollections(java.util.Collection leftCollection,
                               java.util.Collection rightCollection,
                               DiffContext ctx,
                               Result.Strength strength)
Compare collections of DbObjects using their DbObject#diff(DbObject, Results) method. Differences are reported using the specified Difference.Strength.

Specified by:
compareCollections in interface ComparisonUtils
Parameters:
leftCollection -
rightCollection -
differences -
strength -

compareSimple

public void compareSimple(DbProperty left,
                          DbProperty right,
                          DiffContext ctx)
Compare two simple objects. Differences are reported using the default Result.Strength.

Specified by:
compareSimple in interface ComparisonUtils
See Also:
#compareSimple(Object, Object, Results, Strength)

compareSimple

public void compareSimple(DbProperty leftProperty,
                          DbProperty rightProperty,
                          DiffContext ctx,
                          Result.Strength strength)
Compare two 'simple' (i.e. non-DbObject objects) using their Object.equals(Object) method to decide if there is a difference. Differences are reported using the Result.Strength specified.

Specified by:
compareSimple in interface ComparisonUtils
Parameters:
left -
right -
differences -
strength -


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.