@Test public void testGetClassPathEntries() { ImmutableListMultimap<ClassPathEntry, DependencyPath> tree = ImmutableListMultimap.of( jarA, dependencyPath_A, jarB, dependencyPath_B, jarA, dependencyPath_A_B_A); ClassPathResult result = new ClassPathResult(tree, ImmutableSet.of()); ImmutableSet<ClassPathEntry> classPathEntries = result.getClassPathEntries("com.google:a:1"); assertEquals(1, classPathEntries.size()); UnmodifiableIterator<ClassPathEntry> iterator = classPathEntries.iterator(); assertEquals(Paths.get("a.jar"), iterator.next().getJar()); }
public ImmutableSet<ClassPathEntry> getClassPathEntries(String coordinates) { ImmutableSet.Builder<ClassPathEntry> builder = ImmutableSet.builder(); for (ClassPathEntry entry : classPath) { for (DependencyPath dependencyPath : dependencyPaths.get(entry)) { if (dependencyPath.size() > 1) { Artifact artifact = dependencyPath.get(1); if (Artifacts.toCoordinates(artifact).equals(coordinates)) { builder.add(entry); } } } } return builder.build(); }
ClassPathResult { public ImmutableSet<ClassPathEntry> getClassPathEntries(String coordinates) { ImmutableSet.Builder<ClassPathEntry> builder = ImmutableSet.builder(); for (ClassPathEntry entry : classPath) { for (DependencyPath dependencyPath : dependencyPaths.get(entry)) { if (dependencyPath.size() > 1) { Artifact artifact = dependencyPath.get(1); if (Artifacts.toCoordinates(artifact).equals(coordinates)) { builder.add(entry); } } } } return builder.build(); } }
ClassPathResult { public ImmutableSet<ClassPathEntry> getClassPathEntries(String coordinates) { ImmutableSet.Builder<ClassPathEntry> builder = ImmutableSet.builder(); for (ClassPathEntry entry : classPath) { for (DependencyPath dependencyPath : dependencyPaths.get(entry)) { if (dependencyPath.size() > 1) { Artifact artifact = dependencyPath.get(1); if (Artifacts.toCoordinates(artifact).equals(coordinates)) { builder.add(entry); } } } } return builder.build(); } ClassPathResult(
      ListMultimap<ClassPathEntry, DependencyPath> dependencyPaths,
      Iterable<UnresolvableArtifactProblem> artifactProblems); }
ClassPathResult { public ImmutableSet<ClassPathEntry> getClassPathEntries(String coordinates) { ImmutableSet.Builder<ClassPathEntry> builder = ImmutableSet.builder(); for (ClassPathEntry entry : classPath) { for (DependencyPath dependencyPath : dependencyPaths.get(entry)) { if (dependencyPath.size() > 1) { Artifact artifact = dependencyPath.get(1); if (Artifacts.toCoordinates(artifact).equals(coordinates)) { builder.add(entry); } } } } return builder.build(); } ClassPathResult(
      ListMultimap<ClassPathEntry, DependencyPath> dependencyPaths,
      Iterable<UnresolvableArtifactProblem> artifactProblems); ImmutableList<ClassPathEntry> getClassPath(); ImmutableList<DependencyPath> getDependencyPaths(ClassPathEntry entry); ImmutableList<UnresolvableArtifactProblem> getArtifactProblems(); String formatDependencyPaths(Iterable<ClassPathEntry> entries); ImmutableSet<ClassPathEntry> getClassPathEntries(String coordinates); }
ClassPathResult { public ImmutableSet<ClassPathEntry> getClassPathEntries(String coordinates) { ImmutableSet.Builder<ClassPathEntry> builder = ImmutableSet.builder(); for (ClassPathEntry entry : classPath) { for (DependencyPath dependencyPath : dependencyPaths.get(entry)) { if (dependencyPath.size() > 1) { Artifact artifact = dependencyPath.get(1); if (Artifacts.toCoordinates(artifact).equals(coordinates)) { builder.add(entry); } } } } return builder.build(); } ClassPathResult(
      ListMultimap<ClassPathEntry, DependencyPath> dependencyPaths,
      Iterable<UnresolvableArtifactProblem> artifactProblems); ImmutableList<ClassPathEntry> getClassPath(); ImmutableList<DependencyPath> getDependencyPaths(ClassPathEntry entry); ImmutableList<UnresolvableArtifactProblem> getArtifactProblems(); String formatDependencyPaths(Iterable<ClassPathEntry> entries); ImmutableSet<ClassPathEntry> getClassPathEntries(String coordinates);  }