/** * Checks whether this ModuleDependency is satisfied by the dependency of the given ModuleDependency. * If the version string is a defined version, then it does a comparison. If the version string * is a version range if parses this and caters for this. * * @param other The dependency to check for. * @return true if contained false otherwise. */ public boolean contains(ModuleDependency other) { if (other == null || !getName().equals(other.getName())) return false; try { return isVersionRange() ? getVersionAsRange().containsVersion(other.parseVersion()) : parseVersion().compareTo(other.parseVersion()) == 0; } catch (InvalidVersionSpecificationException ivse) { return false; } }