@Test public void fromString() { Form f = new Form().fromString("x=%3D&y=z"); assertThat(f.get("x").get(0)).isEqualTo("="); assertThat(f.get("y").get(0)).isEqualTo("z"); }
public Form fromString(String s) { for (String param : s.split("&")) { String[] nv = param.split("=", 2); if (nv.length == 2) { try { add(URLDecoder.decode(nv[0], "UTF-8"), URLDecoder.decode(nv[1], "UTF-8")); } catch (UnsupportedEncodingException uee) { throw new IllegalStateException(uee); } } } return this; }
Form extends MultiValueMap<String, String> { public Form fromString(String s) { for (String param : s.split("&")) { String[] nv = param.split("=", 2); if (nv.length == 2) { try { add(URLDecoder.decode(nv[0], "UTF-8"), URLDecoder.decode(nv[1], "UTF-8")); } catch (UnsupportedEncodingException uee) { throw new IllegalStateException(uee); } } } return this; } }
Form extends MultiValueMap<String, String> { public Form fromString(String s) { for (String param : s.split("&")) { String[] nv = param.split("=", 2); if (nv.length == 2) { try { add(URLDecoder.decode(nv[0], "UTF-8"), URLDecoder.decode(nv[1], "UTF-8")); } catch (UnsupportedEncodingException uee) { throw new IllegalStateException(uee); } } } return this; } Form(); }
Form extends MultiValueMap<String, String> { public Form fromString(String s) { for (String param : s.split("&")) { String[] nv = param.split("=", 2); if (nv.length == 2) { try { add(URLDecoder.decode(nv[0], "UTF-8"), URLDecoder.decode(nv[1], "UTF-8")); } catch (UnsupportedEncodingException uee) { throw new IllegalStateException(uee); } } } return this; } Form(); Form fromString(String s); @Override String toString(); Form fromRequestQuery(Request request); void toRequestQuery(Request request); void appendRequestQuery(Request request); Form fromRequestEntity(Request request); void toRequestEntity(Request request); }
Form extends MultiValueMap<String, String> { public Form fromString(String s) { for (String param : s.split("&")) { String[] nv = param.split("=", 2); if (nv.length == 2) { try { add(URLDecoder.decode(nv[0], "UTF-8"), URLDecoder.decode(nv[1], "UTF-8")); } catch (UnsupportedEncodingException uee) { throw new IllegalStateException(uee); } } } return this; } Form(); Form fromString(String s); @Override String toString(); Form fromRequestQuery(Request request); void toRequestQuery(Request request); void appendRequestQuery(Request request); Form fromRequestEntity(Request request); void toRequestEntity(Request request);  }