public final class ChannelUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Optional<T> |
getAttribute(io.netty.channel.Channel channel,
io.netty.util.AttributeKey<T> key)
Retrieve optional attribute of the channel
|
static void |
removeIfExists(io.netty.channel.ChannelPipeline pipeline,
Class<? extends io.netty.channel.ChannelHandler>... handlers)
Removes handlers of the given class types from the pipeline.
|
@SafeVarargs public static void removeIfExists(io.netty.channel.ChannelPipeline pipeline, Class<? extends io.netty.channel.ChannelHandler>... handlers)
pipeline
- the pipeline to remove handlers fromhandlers
- handlers to remove, identified by classpublic static <T> Optional<T> getAttribute(io.netty.channel.Channel channel, io.netty.util.AttributeKey<T> key)
T
- the type of the attribute valuechannel
- the channelkey
- the key of the attributeCopyright © 2020. All rights reserved.