Beispiel #1
0
 protected void updateBundleValue(String key, String value) {
   ExtendedJSONObject descriptor = unbundle();
   if (descriptor == null) {
     return;
   }
   descriptor.put(key, value);
   persistBundle(descriptor);
 }
 protected void updateBundleValues(String key, String value, String... more) {
   if (more.length % 2 != 0) {
     throw new IllegalArgumentException("more must be a list of key, value pairs");
   }
   ExtendedJSONObject descriptor = unbundle();
   if (descriptor == null) {
     return;
   }
   descriptor.put(key, value);
   for (int i = 0; i + 1 < more.length; i += 2) {
     descriptor.put(more[i], more[i + 1]);
   }
   persistBundle(descriptor);
 }