@Test public void testRemoveIfExists() { DefaultChannelPipeline pipeline = new DefaultChannelPipeline(new LocalChannel()); ChannelHandler handler1 = newHandler(); ChannelHandler handler2 = newHandler(); ChannelHandler handler3 = newHandler(); pipeline.addLast("handler1", handler1); pipeline.addLast("handler2", handler2); pipeline.addLast("handler3", handler3); assertNotNull(pipeline.removeIfExists(handler1)); assertNull(pipeline.get("handler1")); assertNotNull(pipeline.removeIfExists("handler2")); assertNull(pipeline.get("handler2")); assertNotNull(pipeline.removeIfExists(TestHandler.class)); assertNull(pipeline.get("handler3")); }
public final <T extends ChannelHandler> T removeIfExists(String name) { return removeIfExists(context(name)); }
DefaultChannelPipeline implements ChannelPipeline { public final <T extends ChannelHandler> T removeIfExists(String name) { return removeIfExists(context(name)); } }
DefaultChannelPipeline implements ChannelPipeline { public final <T extends ChannelHandler> T removeIfExists(String name) { return removeIfExists(context(name)); } protected  DefaultChannelPipeline(Channel channel); }
DefaultChannelPipeline implements ChannelPipeline { public final <T extends ChannelHandler> T removeIfExists(String name) { return removeIfExists(context(name)); } protected  DefaultChannelPipeline(Channel channel); @Override final Channel channel(); @Override final ChannelPipeline addFirst(String name, ChannelHandler handler); @Override final ChannelPipeline addFirst(EventExecutorGroup group, String name, ChannelHandler handler); @Override final ChannelPipeline addLast(String name, ChannelHandler handler); @Override final ChannelPipeline addLast(EventExecutorGroup group, String name, ChannelHandler handler); @Override final ChannelPipeline addBefore(String baseName, String name, ChannelHandler handler); @Override final ChannelPipeline addBefore(
            EventExecutorGroup group, String baseName, String name, ChannelHandler handler); @Override final ChannelPipeline addAfter(String baseName, String name, ChannelHandler handler); @Override final ChannelPipeline addAfter(
            EventExecutorGroup group, String baseName, String name, ChannelHandler handler); final ChannelPipeline addFirst(ChannelHandler handler); @Override final ChannelPipeline addFirst(ChannelHandler... handlers); @Override final ChannelPipeline addFirst(EventExecutorGroup executor, ChannelHandler... handlers); final ChannelPipeline addLast(ChannelHandler handler); @Override final ChannelPipeline addLast(ChannelHandler... handlers); @Override final ChannelPipeline addLast(EventExecutorGroup executor, ChannelHandler... handlers); @Override final ChannelPipeline remove(ChannelHandler handler); @Override final ChannelHandler remove(String name); @SuppressWarnings("unchecked") @Override final T remove(Class<T> handlerType); final T removeIfExists(String name); final T removeIfExists(Class<T> handlerType); final T removeIfExists(ChannelHandler handler); @Override final ChannelHandler removeFirst(); @Override final ChannelHandler removeLast(); @Override final ChannelPipeline replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler); @Override final ChannelHandler replace(String oldName, String newName, ChannelHandler newHandler); @Override @SuppressWarnings("unchecked") final T replace(
            Class<T> oldHandlerType, String newName, ChannelHandler newHandler); @Override final ChannelHandler first(); @Override final ChannelHandlerContext firstContext(); @Override final ChannelHandler last(); @Override final ChannelHandlerContext lastContext(); @Override final ChannelHandler get(String name); @SuppressWarnings("unchecked") @Override final T get(Class<T> handlerType); @Override final ChannelHandlerContext context(String name); @Override final ChannelHandlerContext context(ChannelHandler handler); @Override final ChannelHandlerContext context(Class<? extends ChannelHandler> handlerType); @Override final List<String> names(); @Override final Map<String, ChannelHandler> toMap(); @Override final Iterator<Map.Entry<String, ChannelHandler>> iterator(); @Override final String toString(); @Override final ChannelPipeline fireChannelRegistered(); @Override final ChannelPipeline fireChannelUnregistered(); @Override final ChannelPipeline fireChannelActive(); @Override final ChannelPipeline fireChannelInactive(); @Override final ChannelPipeline fireExceptionCaught(Throwable cause); @Override final ChannelPipeline fireUserEventTriggered(Object event); @Override final ChannelPipeline fireChannelRead(Object msg); @Override final ChannelPipeline fireChannelReadComplete(); @Override final ChannelPipeline fireChannelWritabilityChanged(); @Override final ChannelFuture bind(SocketAddress localAddress); @Override final ChannelFuture connect(SocketAddress remoteAddress); @Override final ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress); @Override final ChannelFuture disconnect(); @Override final ChannelFuture close(); @Override final ChannelFuture deregister(); @Override final ChannelPipeline flush(); @Override final ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise); @Override final ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise); @Override final ChannelFuture connect(
            SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise); @Override final ChannelFuture disconnect(ChannelPromise promise); @Override final ChannelFuture close(ChannelPromise promise); @Override final ChannelFuture deregister(final ChannelPromise promise); @Override final ChannelPipeline read(); @Override final ChannelFuture write(Object msg); @Override final ChannelFuture write(Object msg, ChannelPromise promise); @Override final ChannelFuture writeAndFlush(Object msg, ChannelPromise promise); @Override final ChannelFuture writeAndFlush(Object msg); @Override final ChannelPromise newPromise(); @Override final ChannelProgressivePromise newProgressivePromise(); @Override final ChannelFuture newSucceededFuture(); @Override final ChannelFuture newFailedFuture(Throwable cause); @Override final ChannelPromise voidPromise(); }
DefaultChannelPipeline implements ChannelPipeline { public final <T extends ChannelHandler> T removeIfExists(String name) { return removeIfExists(context(name)); } protected  DefaultChannelPipeline(Channel channel); @Override final Channel channel(); @Override final ChannelPipeline addFirst(String name, ChannelHandler handler); @Override final ChannelPipeline addFirst(EventExecutorGroup group, String name, ChannelHandler handler); @Override final ChannelPipeline addLast(String name, ChannelHandler handler); @Override final ChannelPipeline addLast(EventExecutorGroup group, String name, ChannelHandler handler); @Override final ChannelPipeline addBefore(String baseName, String name, ChannelHandler handler); @Override final ChannelPipeline addBefore(
            EventExecutorGroup group, String baseName, String name, ChannelHandler handler); @Override final ChannelPipeline addAfter(String baseName, String name, ChannelHandler handler); @Override final ChannelPipeline addAfter(
            EventExecutorGroup group, String baseName, String name, ChannelHandler handler); final ChannelPipeline addFirst(ChannelHandler handler); @Override final ChannelPipeline addFirst(ChannelHandler... handlers); @Override final ChannelPipeline addFirst(EventExecutorGroup executor, ChannelHandler... handlers); final ChannelPipeline addLast(ChannelHandler handler); @Override final ChannelPipeline addLast(ChannelHandler... handlers); @Override final ChannelPipeline addLast(EventExecutorGroup executor, ChannelHandler... handlers); @Override final ChannelPipeline remove(ChannelHandler handler); @Override final ChannelHandler remove(String name); @SuppressWarnings("unchecked") @Override final T remove(Class<T> handlerType); final T removeIfExists(String name); final T removeIfExists(Class<T> handlerType); final T removeIfExists(ChannelHandler handler); @Override final ChannelHandler removeFirst(); @Override final ChannelHandler removeLast(); @Override final ChannelPipeline replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler); @Override final ChannelHandler replace(String oldName, String newName, ChannelHandler newHandler); @Override @SuppressWarnings("unchecked") final T replace(
            Class<T> oldHandlerType, String newName, ChannelHandler newHandler); @Override final ChannelHandler first(); @Override final ChannelHandlerContext firstContext(); @Override final ChannelHandler last(); @Override final ChannelHandlerContext lastContext(); @Override final ChannelHandler get(String name); @SuppressWarnings("unchecked") @Override final T get(Class<T> handlerType); @Override final ChannelHandlerContext context(String name); @Override final ChannelHandlerContext context(ChannelHandler handler); @Override final ChannelHandlerContext context(Class<? extends ChannelHandler> handlerType); @Override final List<String> names(); @Override final Map<String, ChannelHandler> toMap(); @Override final Iterator<Map.Entry<String, ChannelHandler>> iterator(); @Override final String toString(); @Override final ChannelPipeline fireChannelRegistered(); @Override final ChannelPipeline fireChannelUnregistered(); @Override final ChannelPipeline fireChannelActive(); @Override final ChannelPipeline fireChannelInactive(); @Override final ChannelPipeline fireExceptionCaught(Throwable cause); @Override final ChannelPipeline fireUserEventTriggered(Object event); @Override final ChannelPipeline fireChannelRead(Object msg); @Override final ChannelPipeline fireChannelReadComplete(); @Override final ChannelPipeline fireChannelWritabilityChanged(); @Override final ChannelFuture bind(SocketAddress localAddress); @Override final ChannelFuture connect(SocketAddress remoteAddress); @Override final ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress); @Override final ChannelFuture disconnect(); @Override final ChannelFuture close(); @Override final ChannelFuture deregister(); @Override final ChannelPipeline flush(); @Override final ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise); @Override final ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise); @Override final ChannelFuture connect(
            SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise); @Override final ChannelFuture disconnect(ChannelPromise promise); @Override final ChannelFuture close(ChannelPromise promise); @Override final ChannelFuture deregister(final ChannelPromise promise); @Override final ChannelPipeline read(); @Override final ChannelFuture write(Object msg); @Override final ChannelFuture write(Object msg, ChannelPromise promise); @Override final ChannelFuture writeAndFlush(Object msg, ChannelPromise promise); @Override final ChannelFuture writeAndFlush(Object msg); @Override final ChannelPromise newPromise(); @Override final ChannelProgressivePromise newProgressivePromise(); @Override final ChannelFuture newSucceededFuture(); @Override final ChannelFuture newFailedFuture(Throwable cause); @Override final ChannelPromise voidPromise();  }