Class ChannelUtils


  • public final class ChannelUtils
    extends Object
    • Method Detail

      • removeIfExists

        @SafeVarargs
        public 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.
        Parameters:
        pipeline - the pipeline to remove handlers from
        handlers - handlers to remove, identified by class
      • getAttribute

        public static <T> Optional<T> getAttribute​(io.netty.channel.Channel channel,
                                                   io.netty.util.AttributeKey<T> key)
        Retrieve optional attribute of the channel
        Type Parameters:
        T - the type of the attribute value
        Parameters:
        channel - the channel
        key - the key of the attribute
        Returns:
        optional attribute