Form { private Form(Map<String, String> queryParams,Map<String, String> formParams,Map<String, UploadedFile> files) { this.queryParams = Collections.unmodifiableMap(queryParams); this.formParams = Collections.unmodifiableMap(formParams); this.fileParams = Collections.unmodifiableMap(files); formAndQuery=Maps.newLinkedHashMap(); formAndQuery.putAll(queryParams); formAndQuery.putAll(formParams); formAndQuery=Collections.unmodifiableMap(formAndQuery); } private  Form(Map<String, String> queryParams,Map<String, String> formParams,Map<String, UploadedFile> files); static Form decode(Context context,ByteBuf content); static Form fromQuery(Map<String, String> queryParams); static Form fromAll(Map<String, String> queryParams,Map<String, String> formAndQuery,Map<String, UploadedFile> fileParams); Form withForm(Map<String, String> formParams); Form withFiles(Map<String, UploadedFile> filesParams); UploadedFile getFile(String key); String getAttr(String key); boolean contains(String key); boolean containsAttr(String key); boolean containsFile(String key); Map<String, String> getQuery(); Map<String, String> getAttrs(); Map<String, UploadedFile> getFiles(); Map<String, String> getForm(); Map<String, Object> getAll(); T as(Class<T> clazz); @Override String toString(); static Map<String, String> toFlatQueryParams(Map<String, List<String>> queryParameters);  }
@Test public void form(){ s.chain() .link(new FormExt()) .link(new RouteExt<Context>() {{ get("/hi2", new IRequestHandler<Context>() { @Override public Observable<?> handle(Context ctx) { try { Form form = FormExt.get(ctx); A a=form.as(A.class); return ctx.getResponse().writeStringAndFlush("hi2 " + form.getAttr("a")+" "+a.a); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } } }); }}) ; assertEquals("hi2 aa aa", request().addPath("/hi2").addParameter("a", "aa").get().getString()); }