This commit is contained in:
Redkale
2018-12-01 14:22:30 +08:00
parent 40ae555645
commit 08ee51f8ab

View File

@@ -558,26 +558,26 @@ public abstract class WebSocket<G extends Serializable, T> {
/**
* 获取当前WebSocket下的属性非线程安全
*
* @param <T> 属性值的类型
* @param <V> 属性值的类型
* @param name 属性名
*
* @return 属性值
*/
@SuppressWarnings("unchecked")
public final <T> T getAttribute(String name) {
return attributes == null ? null : (T) attributes.get(name);
public final <V> V getAttribute(String name) {
return attributes == null ? null : (V) attributes.get(name);
}
/**
* 移出当前WebSocket下的属性非线程安全
*
* @param <T> 属性值的类型
* @param <V> 属性值的类型
* @param name 属性名
*
* @return 属性值
*/
public final <T> T removeAttribute(String name) {
return attributes == null ? null : (T) attributes.remove(name);
public final <V> V removeAttribute(String name) {
return attributes == null ? null : (V) attributes.remove(name);
}
/**