@@ -0,0 +1,570 @@
+package com.mercury.chat.common.util;%0D%0A%0D%0Aimport io.netty.channel.Channel;%0D%0Aimport io.netty.util.AttributeKey;%0D%0A%0D%0Apublic class ChannelUtil %7B%0D%0A%09%0D%0A%09public static %3CT%3E T getAttribute(Channel channel, AttributeKey%3CT%3E attributeKey)%7B%0D%0A%09%09return channel.attr(attributeKey).get();%0D%0A%09%7D%0D%0A%09%0D%0A%09public static %3CT%3E void setAttribute(Channel channel, AttributeKey%3CT%3E attributeKey, T value)%7B%0D%0A%09%09channel.attr(attributeKey).setIfAbsent(value);%0D%0A%09%7D%0D%0A%09%0D%0A%09public static %3CT%3E boolean hasAttribute(Channel channel, AttributeKey%3CT%3E attributeKey)%7B%0D%0A%09%09return channel.hasAttr(attributeKey);%0D%0A%09%7D%0D%0A%09%0D%0A%7D%0D%0A

add util method to simple the code.