public void unregister(Class generatorClass) { DatabaseObjectComparator toRemove = null; for (DatabaseObjectComparator existingGenerator : comparators) { if (existingGenerator.getClass().equals(generatorClass)) { toRemove = existingGenerator; } } unregister(toRemove); }
protected List<DatabaseObjectComparator> getComparators( Class<? extends DatabaseObject> comparatorClass, Database database) { String key = comparatorClass.getName() + ":" + database.getShortName(); if (validComparatorsByClassAndDatabase.containsKey(key)) { return validComparatorsByClassAndDatabase.get(key); } List<DatabaseObjectComparator> validComparators = new ArrayList<DatabaseObjectComparator>(); for (DatabaseObjectComparator comparator : comparators) { if (comparator.getPriority(comparatorClass, database) > 0) { validComparators.add(comparator); } } Collections.sort( validComparators, new DatabaseObjectComparatorComparator(comparatorClass, database)); validComparatorsByClassAndDatabase.put(key, validComparators); return validComparators; }