18045010223
7 天以前 afe371d39a054b2f2a9e5875b945584eec8a8141
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package cn.org.hentai.jtt1078.server;
 
import io.netty.channel.Channel;
import org.apache.commons.collections.map.HashedMap;
 
import java.util.Map;
 
public final class SessionManager
{
    private static final Map<String, Object> mappings = new HashedMap();
 
    public static void init()
    {
        // ...
    }
 
    public static <T> T get(Channel channel, String key)
    {
        return (T) mappings.get(channel.id().asLongText() + key);
    }
 
    public static void set(Channel channel, String key, Object value)
    {
        mappings.put(channel.id().asLongText() + key, value);
    }
 
    public static boolean contains(Channel channel, String key)
    {
        return mappings.containsKey(channel.id().asLongText() + key);
    }
}