@Test public void testToString() throws Exception { assertEquals("", new Text(new EncodedPath(new Precoded(""))).toString()); assertEquals("/", new Text(new EncodedPath(new Precoded("/"))).toString()); assertEquals("abc", new Text(new EncodedPath(new Precoded("abc"))).toString()); assertEquals("abc/def", new Text(new EncodedPath(new Precoded("abc/def"))).toString()); assertEquals("../abc/./def", new Text(new EncodedPath(new Precoded("../abc/./def"))).toString()); }
@Override public String toString() { if (mPath == null) { StringBuilder stringBuilder = new StringBuilder(256); boolean first = true; for (UriEncoded segment : mDelegate) { if (first) { first = false; } else { stringBuilder.append('/'); } stringBuilder.append(segment); } mPath = stringBuilder.toString(); } return mPath; }
Text implements CharSequence { @Override public String toString() { if (mPath == null) { StringBuilder stringBuilder = new StringBuilder(256); boolean first = true; for (UriEncoded segment : mDelegate) { if (first) { first = false; } else { stringBuilder.append('/'); } stringBuilder.append(segment); } mPath = stringBuilder.toString(); } return mPath; } }
Text implements CharSequence { @Override public String toString() { if (mPath == null) { StringBuilder stringBuilder = new StringBuilder(256); boolean first = true; for (UriEncoded segment : mDelegate) { if (first) { first = false; } else { stringBuilder.append('/'); } stringBuilder.append(segment); } mPath = stringBuilder.toString(); } return mPath; } Text(Path delegate); }
Text implements CharSequence { @Override public String toString() { if (mPath == null) { StringBuilder stringBuilder = new StringBuilder(256); boolean first = true; for (UriEncoded segment : mDelegate) { if (first) { first = false; } else { stringBuilder.append('/'); } stringBuilder.append(segment); } mPath = stringBuilder.toString(); } return mPath; } Text(Path delegate); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int beginIndex, int endIndex); @Override String toString(); }
Text implements CharSequence { @Override public String toString() { if (mPath == null) { StringBuilder stringBuilder = new StringBuilder(256); boolean first = true; for (UriEncoded segment : mDelegate) { if (first) { first = false; } else { stringBuilder.append('/'); } stringBuilder.append(segment); } mPath = stringBuilder.toString(); } return mPath; } Text(Path delegate); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int beginIndex, int endIndex); @Override String toString();  }