18045010223
8 天以前 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
32
33
34
35
36
37
38
package cn.org.hentai.jtt1078.server;
 
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
 
/**
 * Created by matrixy on 2019/4/10.
 */
public final class Session
{
    Map<String, Object> attributes;
    public Session()
    {
        this.attributes = new HashMap<String, Object>();
    }
 
    public Session set(String key, Object value)
    {
        this.attributes.put(key, value);
        return this;
    }
 
    public boolean has(String key)
    {
        return this.attributes.containsKey(key);
    }
 
    public Set<String> keys()
    {
        return this.attributes.keySet();
    }
 
    public <T> T get(String key)
    {
        return (T) this.attributes.get(key);
    }
}