@Test public void unwrap() { performer.onserver(new Action<ServerWebSocket>() { @Override public void on(ServerWebSocket ws) { assertThat(ws.unwrap(ChannelHandlerContext.class), instanceOf(ChannelHandlerContext.class)); assertThat(ws.unwrap(WebSocketServerHandshaker.class), instanceOf(WebSocketServerHandshaker.class)); assertThat(ws.unwrap(FullHttpRequest.class), instanceOf(FullHttpRequest.class)); performer.start(); } }) .connect(); }
@Override public <T> T unwrap(Class<T> clazz) { return ChannelHandlerContext.class.isAssignableFrom(clazz) ? clazz.cast(context) : WebSocketServerHandshaker.class.isAssignableFrom(clazz) ? clazz.cast(handshaker) : FullHttpRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : null; }
NettyServerWebSocket extends AbstractServerWebSocket { @Override public <T> T unwrap(Class<T> clazz) { return ChannelHandlerContext.class.isAssignableFrom(clazz) ? clazz.cast(context) : WebSocketServerHandshaker.class.isAssignableFrom(clazz) ? clazz.cast(handshaker) : FullHttpRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : null; } }
NettyServerWebSocket extends AbstractServerWebSocket { @Override public <T> T unwrap(Class<T> clazz) { return ChannelHandlerContext.class.isAssignableFrom(clazz) ? clazz.cast(context) : WebSocketServerHandshaker.class.isAssignableFrom(clazz) ? clazz.cast(handshaker) : FullHttpRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : null; } NettyServerWebSocket(ChannelHandlerContext context, FullHttpRequest req, WebSocketServerHandshaker handshaker); }
NettyServerWebSocket extends AbstractServerWebSocket { @Override public <T> T unwrap(Class<T> clazz) { return ChannelHandlerContext.class.isAssignableFrom(clazz) ? clazz.cast(context) : WebSocketServerHandshaker.class.isAssignableFrom(clazz) ? clazz.cast(handshaker) : FullHttpRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : null; } NettyServerWebSocket(ChannelHandlerContext context, FullHttpRequest req, WebSocketServerHandshaker handshaker); @Override String uri(); @Override T unwrap(Class<T> clazz); }
NettyServerWebSocket extends AbstractServerWebSocket { @Override public <T> T unwrap(Class<T> clazz) { return ChannelHandlerContext.class.isAssignableFrom(clazz) ? clazz.cast(context) : WebSocketServerHandshaker.class.isAssignableFrom(clazz) ? clazz.cast(handshaker) : FullHttpRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : null; } NettyServerWebSocket(ChannelHandlerContext context, FullHttpRequest req, WebSocketServerHandshaker handshaker); @Override String uri(); @Override T unwrap(Class<T> clazz);  }