Package com.goodow.realtime.json

Examples of com.goodow.realtime.json.JsonArray.toJsonString()


    VertxAssert.assertEquals(4, map.size());
    VertxAssert.assertEquals("v1", map.get("k1"));
    VertxAssert.assertEquals(4d, map.<Double> get("k2"), 0d);
    VertxAssert.assertEquals(false, map.get("k3"));
    VertxAssert.assertTrue(v4.toJsonString().equals(map.<JsonArray> get("k4").toJsonString()));

    VertxAssert.assertEquals("v1", map.set("k1", ""));
    VertxAssert.assertEquals(4.0, map.set("k2", null));
    VertxAssert.assertEquals(false, map.set("k3", null));
    VertxAssert.assertEquals(2, map.size());
View Full Code Here


        new ValueChangedEventImpl(event(sessionId, userId).set("property", key).set("oldValue",
            get(key)).set("newValue", newObject));
    if (snapshot.has(key)) {
      JsonArray oldValue = snapshot.getArray(key);
      model.addOrRemoveParent(oldValue, id, false);
      model.bytesUsed -= oldValue.toJsonString().length();
    }
    snapshot.set(key, newValue);
    model.addOrRemoveParent(newValue, id, true);
    fireEvent(event);
    model.bytesUsed += newValue.toJsonString().length();
View Full Code Here

        new ValueChangedEventImpl(event(sessionId, userId).set("property", key).set("oldValue",
            get(key)).set("newValue", null));
    snapshot.remove(key);
    model.addOrRemoveParent(oldValue, id, false);
    fireEvent(event);
    model.bytesUsed -= oldValue.toJsonString().length();
  }
}
View Full Code Here

    for (int i = 0; i < length; i++) {
      objects.push(get(index));
      JsonArray value = snapshot.getArray(index);
      snapshot.remove(index);
      model.addOrRemoveParent(value, id, false);
      model.bytesUsed -= (value == null ? "null" : value.toJsonString()).length();
    }
    ValuesRemovedEvent event =
        new ValuesRemovedEventImpl(event(sessionId, userId).set("index", index).set("values", objects));
    fireEvent(event);
  }
View Full Code Here

        JsonArray oldValue = snapshot.getArray(index + idx);
        snapshot.remove(index + idx);
        snapshot.insert(index + idx++, newValue);
        model.addOrRemoveParent(oldValue, id, false);
        model.addOrRemoveParent(newValue, id, true);
        model.bytesUsed -= (oldValue == null ? "null" : oldValue.toJsonString()).length();
        model.bytesUsed += (newValue == null ? "null" : newValue.toJsonString()).length();
      }
    });
    ValuesSetEvent event =
        new ValuesSetEventImpl(event(sessionId, userId).set("index", index).set("oldValues",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.