@Test public void unwrap() { performer.onserver(new Action<ServerHttpExchange>() { @Override public void on(ServerHttpExchange http) { assertThat(http.unwrap(HttpServletRequest.class), instanceOf(HttpServletRequest.class)); assertThat(http.unwrap(HttpServletResponse.class), instanceOf(HttpServletResponse.class)); performer.start(); } }) .send(); }
@Override public <T> T unwrap(Class<T> clazz) { return HttpServletRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : HttpServletResponse.class.isAssignableFrom(clazz) ? clazz.cast(response) : null; }
ServletServerHttpExchange extends AbstractServerHttpExchange { @Override public <T> T unwrap(Class<T> clazz) { return HttpServletRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : HttpServletResponse.class.isAssignableFrom(clazz) ? clazz.cast(response) : null; } }
ServletServerHttpExchange extends AbstractServerHttpExchange { @Override public <T> T unwrap(Class<T> clazz) { return HttpServletRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : HttpServletResponse.class.isAssignableFrom(clazz) ? clazz.cast(response) : null; } ServletServerHttpExchange(HttpServletRequest request, HttpServletResponse response); }
ServletServerHttpExchange extends AbstractServerHttpExchange { @Override public <T> T unwrap(Class<T> clazz) { return HttpServletRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : HttpServletResponse.class.isAssignableFrom(clazz) ? clazz.cast(response) : null; } ServletServerHttpExchange(HttpServletRequest request, HttpServletResponse response); @Override String uri(); @Override String method(); @Override Set<String> headerNames(); @Override List<String> headers(String name); @Override T unwrap(Class<T> clazz); }
ServletServerHttpExchange extends AbstractServerHttpExchange { @Override public <T> T unwrap(Class<T> clazz) { return HttpServletRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : HttpServletResponse.class.isAssignableFrom(clazz) ? clazz.cast(response) : null; } ServletServerHttpExchange(HttpServletRequest request, HttpServletResponse response); @Override String uri(); @Override String method(); @Override Set<String> headerNames(); @Override List<String> headers(String name); @Override T unwrap(Class<T> clazz);  }