private int compare(ComponentId n1, ComponentId n2) { if (n1 == null && n2 == null) return 0; if (n1 == null) return -1; if (n2 == null) return 1; return n1.compareTo(n2); }
/** * @return true if a newer than b */ private boolean newerVersion(ComponentId a, ComponentId b) { return a.compareTo(b) > 0; }
/** Order by id order. It is permissible to change the order definition in subclasses */ @Override public int compareTo(Component other) { return id.compareTo(other.getId()); }
@Override public int compareTo(Component<?, ?> other) { return getComponentId().compareTo(other.getComponentId()); }