DummyOfflineWebPreferences.java
1.45 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.mumfrey.webprefs;
import java.util.UUID;
/**
* No-op webpreferences set which is returned for nonlocal players when the
* client is running in offline mode.
*/
public class DummyOfflineWebPreferences extends AbstractWebPreferences
{
DummyOfflineWebPreferences(UUID uuid, boolean isPrivate, boolean isReadOnly)
{
this(uuid.toString(), isPrivate, isReadOnly);
}
public DummyOfflineWebPreferences(String uuid, boolean isPrivate, boolean isReadOnly)
{
super(uuid, isPrivate, isReadOnly);
}
/* (non-Javadoc)
* @see com.mumfrey.webprefs.interfaces.IWebPreferences#poll()
*/
@Override
public void poll()
{
}
/* (non-Javadoc)
* @see com.mumfrey.webprefs.interfaces.IWebPreferences
* #has(java.lang.String)
*/
@Override
public boolean has(String key)
{
WebPreferences.validateKey(key);
return false;
}
/* (non-Javadoc)
* @see com.mumfrey.webprefs.interfaces.IWebPreferences
* #get(java.lang.String)
*/
@Override
public String get(String key)
{
WebPreferences.validateKey(key);
return "";
}
/* (non-Javadoc)
* @see com.mumfrey.webprefs.interfaces.IWebPreferences
* #get(java.lang.String, java.lang.String)
*/
@Override
public String get(String key, String defaultValue)
{
WebPreferences.validateKey(key);
return defaultValue;
}
}