/** * Indicates whether the given {@link Dependency} has the same Maven * coordinates as this one; this is not necessarily the same as calling * {@link #equals(Object)}, which may compare more fields beyond the basic * coordinates. * * @param dependency the dependency to check (can be <code>null</code>) * @return <code>false</code> if any coordinates are different */ public boolean hasSameCoordinates(final Dependency dependency) { return dependency != null && compareCoordinates(dependency) == 0; }
public int compareTo(final Dependency o) { final int result = compareCoordinates(o); if (result != 0) { return result; } return version.compareTo(o.getVersion()); }