Examples of RobotSearchDigestGsonImpl


Examples of com.google.walkaround.proto.gson.RobotSearchDigestGsonImpl

  }

  private RemoteConvWavelet parseWaveletEntity(Entity entity) {
    Pair<SourceInstance, WaveletName> instanceAndWaveId = parseWaveletKey(entity.getKey());
    try {
      RobotSearchDigest digest = GsonProto.fromGson(new RobotSearchDigestGsonImpl(),
          DatastoreUtil.getExistingProperty(entity, WAVELET_DIGEST_PROPERTY, Text.class)
          .getValue());
      Assert.check(
          instanceAndWaveId.getSecond().waveId.equals(WaveId.deserialise(digest.getWaveId())),
          "Wave id mismatch: %s, %s", instanceAndWaveId, entity);
View Full Code Here

Examples of com.google.walkaround.proto.gson.RobotSearchDigestGsonImpl

  private Entity serializeWavelet(StableUserId userId, RemoteConvWavelet w) {
    Key key = makeWaveletKey(userId, w.getSourceInstance(), getWaveletName(w));
    Entity e = new Entity(key);
    DatastoreUtil.setNonNullUnindexedProperty(e, WAVELET_DIGEST_PROPERTY,
        new Text(GsonProto.toJson(new RobotSearchDigestGsonImpl(w.getDigest()))));
    DatastoreUtil.setNonNullIndexedProperty(e, WAVELET_LAST_MODIFIED_MILLIS_PROPERTY,
        w.getDigest().getLastModifiedMillis());
    DatastoreUtil.setOrRemoveIndexedProperty(e, WAVELET_PRIVATE_LOCAL_ID_PROPERTY,
        w.getPrivateLocalId() == null ? null : w.getPrivateLocalId().getId());
    DatastoreUtil.setOrRemoveIndexedProperty(e, WAVELET_SHARED_LOCAL_ID_PROPERTY,
View Full Code Here

Examples of com.google.walkaround.proto.gson.RobotSearchDigestGsonImpl

        }
        JSONArray rawDigests = results.getJSONArray("digests");
        for (int i = 0; i < rawDigests.length(); i++) {
          JSONObject rawDigest = rawDigests.getJSONObject(i);
          try {
            RobotSearchDigest digest = new RobotSearchDigestGsonImpl();
            digest.setWaveId(WaveId.deserialise(rawDigest.getString("waveId")).serialise());
            JSONArray rawParticipants = rawDigest.getJSONArray("participants");
            for (int j = 0; j < rawParticipants.length(); j++) {
              digest.addParticipant(rawParticipants.getString(j));
            }
            digest.setTitle(rawDigest.getString("title"));
            digest.setSnippet(rawDigest.getString("snippet"));
            digest.setLastModifiedMillis(rawDigest.getLong("lastModified"));
            digest.setBlipCount(rawDigest.getInt("blipCount"));
            digest.setUnreadBlipCount(rawDigest.getInt("unreadCount"));
            digests.add(digest);
          } catch (JSONException e) {
            throw new RuntimeException("Failed to parse search digest: " + rawDigest, e);
          }
        }
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.