@Override public boolean equals(Object o) { if (this == o) return true; if (o instanceof DependencyId) { DependencyId that = (DependencyId) o; return this.hashCode() == that.hashCode() && equal(groupId, that.groupId) && equal(artifactId, that.artifactId) && equal(classifier, that.classifier) && equal(extension, that.extension); } return false; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o instanceof DependencyId) { DependencyId that = (DependencyId) o; return this.hashCode() == that.hashCode() && equal(groupId, that.groupId) && equal(artifactId, that.artifactId) && equal(classifier, that.classifier) && equal(extension, that.extension); } return false; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o instanceof DependencyTree) { DependencyTree that = (DependencyTree) o; return hashCode() == that.hashCode() && equal(dependencyId, that.dependencyId) && equal(version, that.version) && equal(children, that.children); } else { return false; } }
public static Bundle findBundle(BundleContext bundleContext, String name, String version) { Version v = Versions.fromMavenVersion(version); Bundle[] bundles = bundleContext.getBundles(); for (Bundle bundle : bundles) { // TODO should be using ranges here!! if (Objects.equal(bundle.getSymbolicName(), name) && Objects.equal(bundle.getVersion(), v)) { return bundle; } } return null; }
public static Bundle findBundle(BundleContext bundleContext, String name, String version) { Version v = Versions.fromMavenVersion(version); Bundle[] bundles = bundleContext.getBundles(); for (Bundle bundle : bundles) { // TODO should be using ranges here!! if (Objects.equal(bundle.getSymbolicName(), name) && Objects.equal(bundle.getVersion(), v)) { return bundle; } } return null; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o instanceof DependencyTree) { DependencyTree that = (DependencyTree) o; return hashCode() == that.hashCode() && equal(dependencyId, that.dependencyId) && equal(version, that.version) && equal(children, that.children); } else { return false; } }
/** * Find installed bundles by symbolic name * * @param context the bundle context to search * @param name the bundle symbolic name * @return the set of bundles found */ public static Set<Bundle> findBundles(BundleContext context, String name) { Set<Bundle> result = new HashSet<Bundle>(); Bundle[] bundles = context.getBundles(); for (Bundle bundle : bundles) { if (Objects.equal(bundle.getSymbolicName(), name)) { result.add(bundle); } } return result; }
/** * Find installed bundles by symbolic name * * @param context the bundle context to search * @param name the bundle symbolic name * @return the set of bundles found */ public static Set<Bundle> findBundles(BundleContext context, String name) { Set<Bundle> result = new HashSet<Bundle>(); Bundle[] bundles = context.getBundles(); for (Bundle bundle : bundles) { if (Objects.equal(bundle.getSymbolicName(), name)) { result.add(bundle); } } return result; }
protected Installation findProcessInstallation(String id) { List<Installation> installations = processManager.listInstallations(); for (Installation installation : installations) { String name = installation.getName(); if (Objects.equal(id, name)) { return installation; } } return null; }
private boolean isNewer(Artifact a1, Artifact a2) { if (Objects.equal(a1.getGroupId(), a2.getGroupId()) && Objects.equal(a1.getArtifactId(), a2.getArtifactId()) && Objects.equal(a1.getExtension(), a2.getExtension()) && Objects.equal(a1.getClassifier(), a2.getClassifier())) { String v1 = a1.getVersion(); String v2 = a2.getVersion(); if (!Objects.equal(v1, v2)) { int c = v1.compareTo(v2); return c > 0; } } return false; } }
private boolean isNewer(Artifact a1, Artifact a2) { if (Objects.equal(a1.getGroupId(), a2.getGroupId()) && Objects.equal(a1.getArtifactId(), a2.getArtifactId()) && Objects.equal(a1.getExtension(), a2.getExtension()) && Objects.equal(a1.getClassifier(), a2.getClassifier())) { String v1 = a1.getVersion(); String v2 = a2.getVersion(); if (!Objects.equal(v1, v2)) { int c = v1.compareTo(v2); return c > 0; } } return false; } }