@Test public void wireFormat() { Assert.assertEquals("/", Path.getEmptyPath().wireFormat()); Assert.assertEquals("a/b/c", new Path("/a/b Assert.assertEquals("b/c", new Path("/a/b }
public String wireFormat() { if (this.isEmpty()) { return "/"; } else { StringBuilder builder = new StringBuilder(); for (int i = this.start; i < this.end; i++) { if (i > this.start) { builder.append("/"); } builder.append(pieces[i].asString()); } return builder.toString(); } }
Path implements Iterable<ChildKey>, Comparable<Path> { public String wireFormat() { if (this.isEmpty()) { return "/"; } else { StringBuilder builder = new StringBuilder(); for (int i = this.start; i < this.end; i++) { if (i > this.start) { builder.append("/"); } builder.append(pieces[i].asString()); } return builder.toString(); } } }
Path implements Iterable<ChildKey>, Comparable<Path> { public String wireFormat() { if (this.isEmpty()) { return "/"; } else { StringBuilder builder = new StringBuilder(); for (int i = this.start; i < this.end; i++) { if (i > this.start) { builder.append("/"); } builder.append(pieces[i].asString()); } return builder.toString(); } } Path(ChildKey... segments);  Path(List<String> segments);  Path(String pathString); private  Path(ChildKey[] pieces, int start, int end); }
Path implements Iterable<ChildKey>, Comparable<Path> { public String wireFormat() { if (this.isEmpty()) { return "/"; } else { StringBuilder builder = new StringBuilder(); for (int i = this.start; i < this.end; i++) { if (i > this.start) { builder.append("/"); } builder.append(pieces[i].asString()); } return builder.toString(); } } Path(ChildKey... segments);  Path(List<String> segments);  Path(String pathString); private  Path(ChildKey[] pieces, int start, int end); static Path getRelative(Path from, Path to); static Path getEmptyPath(); Path child(Path path); Path child(ChildKey child); @Override String toString(); String wireFormat(); List<String> asList(); ChildKey getFront(); Path popFront(); Path getParent(); ChildKey getBack(); boolean isEmpty(); int size(); @Override Iterator<ChildKey> iterator(); boolean contains(Path other); @Override boolean equals(Object other); @Override int hashCode(); @Override int compareTo(Path other); }
Path implements Iterable<ChildKey>, Comparable<Path> { public String wireFormat() { if (this.isEmpty()) { return "/"; } else { StringBuilder builder = new StringBuilder(); for (int i = this.start; i < this.end; i++) { if (i > this.start) { builder.append("/"); } builder.append(pieces[i].asString()); } return builder.toString(); } } Path(ChildKey... segments);  Path(List<String> segments);  Path(String pathString); private  Path(ChildKey[] pieces, int start, int end); static Path getRelative(Path from, Path to); static Path getEmptyPath(); Path child(Path path); Path child(ChildKey child); @Override String toString(); String wireFormat(); List<String> asList(); ChildKey getFront(); Path popFront(); Path getParent(); ChildKey getBack(); boolean isEmpty(); int size(); @Override Iterator<ChildKey> iterator(); boolean contains(Path other); @Override boolean equals(Object other); @Override int hashCode(); @Override int compareTo(Path other);  }