Adjust ChannelPipeline to support method-chaining in a consistent way
This commit is contained in:
parent
caa698f235
commit
ba3c795fdf
@ -346,7 +346,7 @@ public interface ChannelPipeline extends ChannelInboundInvoker, ChannelOutboundI
|
||||
* @throws NullPointerException
|
||||
* if the specified handler is {@code null}
|
||||
*/
|
||||
void remove(ChannelHandler handler);
|
||||
ChannelPipeline remove(ChannelHandler handler);
|
||||
|
||||
/**
|
||||
* Removes the {@link ChannelHandler} with the specified name from this
|
||||
@ -410,7 +410,7 @@ public interface ChannelPipeline extends ChannelInboundInvoker, ChannelOutboundI
|
||||
* if the specified old handler, new name, or new handler is
|
||||
* {@code null}
|
||||
*/
|
||||
void replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler);
|
||||
ChannelPipeline replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler);
|
||||
|
||||
/**
|
||||
* Replaces the {@link ChannelHandler} of the specified name with a new
|
||||
|
@ -341,8 +341,9 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(ChannelHandler handler) {
|
||||
public ChannelPipeline remove(ChannelHandler handler) {
|
||||
remove(getContextOrDie(handler));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -478,8 +479,9 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler) {
|
||||
public ChannelPipeline replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler) {
|
||||
replace(getContextOrDie(oldHandler), newName, newHandler);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user