liquibase.diff
Class ObjectDifferences

java.lang.Object
  extended by liquibase.diff.ObjectDifferences

public class ObjectDifferences
extends Object


Nested Class Summary
static interface ObjectDifferences.CompareFunction
           
static class ObjectDifferences.DatabaseObjectNameCompareFunction
           
static class ObjectDifferences.DataTypeCompareFunction
           
static class ObjectDifferences.OrderedCollectionCompareFunction
           
static class ObjectDifferences.StandardCompareFunction
           
static class ObjectDifferences.ToStringCompareFunction
           
static class ObjectDifferences.UnOrderedCollectionCompareFunction
           
 
Constructor Summary
ObjectDifferences(CompareControl compareControl)
           
 
Method Summary
 ObjectDifferences addDifference(String changedField, Object referenceValue, Object compareToValue)
           
 ObjectDifferences addDifference(String message, String changedField, Object referenceValue, Object compareToValue)
           
 void compare(String attribute, DatabaseObject referenceObject, DatabaseObject compareToObject, ObjectDifferences.CompareFunction compareFunction)
           
 void compare(String message, String attribute, DatabaseObject referenceObject, DatabaseObject compareToObject, ObjectDifferences.CompareFunction compareFunction)
           
 Difference getDifference(String field)
           
 Set<Difference> getDifferences()
           
 CompareControl.SchemaComparison[] getSchemaComparisons()
           
 boolean hasDifferences()
           
 boolean isDifferent(String field)
           
 boolean removeDifference(String attribute)
           
protected  Object undoCollection(Object potentialCollection, Object otherObject)
          Sometimes an attribute in one object is a single-entity collection and on the other it is just the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectDifferences

public ObjectDifferences(CompareControl compareControl)
Method Detail

getDifferences

public Set<Difference> getDifferences()

getDifference

public Difference getDifference(String field)

isDifferent

public boolean isDifferent(String field)

addDifference

public ObjectDifferences addDifference(String changedField,
                                       Object referenceValue,
                                       Object compareToValue)

addDifference

public ObjectDifferences addDifference(String message,
                                       String changedField,
                                       Object referenceValue,
                                       Object compareToValue)

hasDifferences

public boolean hasDifferences()

compare

public void compare(String attribute,
                    DatabaseObject referenceObject,
                    DatabaseObject compareToObject,
                    ObjectDifferences.CompareFunction compareFunction)

compare

public void compare(String message,
                    String attribute,
                    DatabaseObject referenceObject,
                    DatabaseObject compareToObject,
                    ObjectDifferences.CompareFunction compareFunction)

undoCollection

protected Object undoCollection(Object potentialCollection,
                                Object otherObject)
Sometimes an attribute in one object is a single-entity collection and on the other it is just the object. Check the passed potentialCollection and if it is a single-entry collection of the same type as the otherObject, return just the collection element. Otherwise, return the original collection.


removeDifference

public boolean removeDifference(String attribute)

getSchemaComparisons

public CompareControl.SchemaComparison[] getSchemaComparisons()


Copyright © 2016 Liquibase.org. All rights reserved.