tbrugz.sqldiff.compare.DiffComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqldump Show documentation
Show all versions of sqldump Show documentation
Utility to dump schema and data from a RDBMS
package tbrugz.sqldiff.compare;
import java.util.Comparator;
import tbrugz.sqldiff.model.Diff;
public class DiffComparator implements Comparator {
@Override
public int compare(Diff o1, Diff o2) {
if(o1==null || o2==null) { return 0; }
//changetype
int comp = o1.getChangeType().compareTo(o2.getChangeType());
if(comp!=0) return -comp;
//difftype
comp = o1.getObjectType().compareTo(o2.getObjectType());
//if(comp!=0) return comp;
return comp;
}
}