@Test public void testToString() { Assert.assertEquals( "a:b:jar:1 / com.google:foo:1 (test) / com.google:bar:1 (compile, optional)", pathRootFooBar.toString()); }
@Override public String toString() { List<String> formatted = path.stream().map(DependencyPath::formatDependency).collect(Collectors.toList()); StringBuilder builder = new StringBuilder(); if (root != null) { builder.append(root); if (!path.isEmpty()) { builder.append(" / "); } } builder.append(Joiner.on(" / ").join(formatted)); return builder.toString(); }
DependencyPath { @Override public String toString() { List<String> formatted = path.stream().map(DependencyPath::formatDependency).collect(Collectors.toList()); StringBuilder builder = new StringBuilder(); if (root != null) { builder.append(root); if (!path.isEmpty()) { builder.append(" / "); } } builder.append(Joiner.on(" / ").join(formatted)); return builder.toString(); } }
DependencyPath { @Override public String toString() { List<String> formatted = path.stream().map(DependencyPath::formatDependency).collect(Collectors.toList()); StringBuilder builder = new StringBuilder(); if (root != null) { builder.append(root); if (!path.isEmpty()) { builder.append(" / "); } } builder.append(Joiner.on(" / ").join(formatted)); return builder.toString(); } DependencyPath(@Nullable Artifact root); }
DependencyPath { @Override public String toString() { List<String> formatted = path.stream().map(DependencyPath::formatDependency).collect(Collectors.toList()); StringBuilder builder = new StringBuilder(); if (root != null) { builder.append(root); if (!path.isEmpty()) { builder.append(" / "); } } builder.append(Joiner.on(" / ").join(formatted)); return builder.toString(); } DependencyPath(@Nullable Artifact root); @VisibleForTesting DependencyPath append(Dependency dependency); DependencyPath concat(DependencyPath childPath); int size(); Artifact getLeaf(); ImmutableList<String> getArtifactKeys(); Artifact get(int i); Dependency getDependency(int i); Artifact findExclusion(String groupId, String artifactId); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
DependencyPath { @Override public String toString() { List<String> formatted = path.stream().map(DependencyPath::formatDependency).collect(Collectors.toList()); StringBuilder builder = new StringBuilder(); if (root != null) { builder.append(root); if (!path.isEmpty()) { builder.append(" / "); } } builder.append(Joiner.on(" / ").join(formatted)); return builder.toString(); } DependencyPath(@Nullable Artifact root); @VisibleForTesting DependencyPath append(Dependency dependency); DependencyPath concat(DependencyPath childPath); int size(); Artifact getLeaf(); ImmutableList<String> getArtifactKeys(); Artifact get(int i); Dependency getDependency(int i); Artifact findExclusion(String groupId, String artifactId); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }