projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch from GPLv2 to GPLv2+
[fw/altos]
/
altoslib
/
AltosPreferencesBackend.java
diff --git
a/altoslib/AltosPreferencesBackend.java
b/altoslib/AltosPreferencesBackend.java
index 9131ad39b5d0c72190c5e7967bfa6a2814675a0f..327b534c05fa0155cf4099a805d2bb9023f74ea1 100644
(file)
--- a/
altoslib/AltosPreferencesBackend.java
+++ b/
altoslib/AltosPreferencesBackend.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-38,16
+39,20
@@
public abstract class AltosPreferencesBackend {
public abstract byte[] getBytes(String key, byte[] def);
public abstract void putBytes(String key, byte[] value);
public abstract byte[] getBytes(String key, byte[] def);
public abstract void putBytes(String key, byte[] value);
- public Altos
HashSet getHashSet
(String key) {
+ public Altos
Json getJson
(String key) {
String value = getString(key, null);
if (value == null)
return null;
String value = getString(key, null);
if (value == null)
return null;
- return AltosHashSet.fromString(value);
+ try {
+ return AltosJson.fromString(value);
+ } catch (IllegalArgumentException ie) {
+ return null;
+ }
}
}
- public void put
HashSet(String key, AltosHashSet h
) {
- putString(key,
h
.toString());
+ public void put
Json(String key, AltosJson j
) {
+ putString(key,
j
.toString());
}
public abstract boolean nodeExists(String key);
}
public abstract boolean nodeExists(String key);