blob: d20106ac5aa07bac4aff21e57fc77bb8047a2ed9 [file] [log] [blame]
package org.eclipse.indigo.tests.utils;
import java.util.Comparator;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
public class IUIdComparator implements Comparator<IInstallableUnit> {
public int compare(IInstallableUnit iu1, IInstallableUnit iu2) {
// neither iu should be null ... but, just to cover all cases
if ((iu1 == null) && (iu2 == null)) {
return 0;
}
else if ((iu1 == null) || (iu2 == null)) {
return 1;
}
else {
return iu1.getId().compareTo(iu2.getId());
}
}
}