@Test public void testFullParams() { DownloadMediaOptions.Builder builder = new DownloadMediaOptions.Builder(); builder.allowStretch(true) .backgroundColor("black") .database("web") .disableMediaCaching(true) .height(100) .width(100) .language("en") .maxHeight(100) .maxWidth(100) .scale(0.3f) .thumbnail(true); assertNotNull(builder.build()); String finalURL = builder.build().toString(); assertEquals("?w=100&thn=1&db=web&dmc=1&la=en&as=1&mh=100&sc=0.3&mw=100&bc=black&h=100", finalURL); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); boolean firstTime = true; for (String key : mParams.keySet()) { builder.append(firstTime ? "?" : "&"); if (firstTime) firstTime = false; String value = mParams.get(key); builder.append(key).append("=").append(value); } return builder.toString(); }
DownloadMediaOptions { @Override public String toString() { StringBuilder builder = new StringBuilder(); boolean firstTime = true; for (String key : mParams.keySet()) { builder.append(firstTime ? "?" : "&"); if (firstTime) firstTime = false; String value = mParams.get(key); builder.append(key).append("=").append(value); } return builder.toString(); } }
DownloadMediaOptions { @Override public String toString() { StringBuilder builder = new StringBuilder(); boolean firstTime = true; for (String key : mParams.keySet()) { builder.append(firstTime ? "?" : "&"); if (firstTime) firstTime = false; String value = mParams.get(key); builder.append(key).append("=").append(value); } return builder.toString(); } private  DownloadMediaOptions(HashMap<String, String> params); }
DownloadMediaOptions { @Override public String toString() { StringBuilder builder = new StringBuilder(); boolean firstTime = true; for (String key : mParams.keySet()) { builder.append(firstTime ? "?" : "&"); if (firstTime) firstTime = false; String value = mParams.get(key); builder.append(key).append("=").append(value); } return builder.toString(); } private  DownloadMediaOptions(HashMap<String, String> params); @Override String toString(); }
DownloadMediaOptions { @Override public String toString() { StringBuilder builder = new StringBuilder(); boolean firstTime = true; for (String key : mParams.keySet()) { builder.append(firstTime ? "?" : "&"); if (firstTime) firstTime = false; String value = mParams.get(key); builder.append(key).append("=").append(value); } return builder.toString(); } private  DownloadMediaOptions(HashMap<String, String> params); @Override String toString();  }