Package com.google.walkaround.proto

Examples of com.google.walkaround.proto.RobotSearchDigest


  }

  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);
      Assert.check(DatastoreUtil.getExistingProperty(
              entity, WAVELET_LAST_MODIFIED_MILLIS_PROPERTY, Long.class)
          .equals(digest.getLastModifiedMillis()),
          "Mismatched last modified times: %s, %s", digest, entity);
      @Nullable String privateLocalId = DatastoreUtil.getOptionalProperty(
          entity, WAVELET_PRIVATE_LOCAL_ID_PROPERTY, String.class);
      @Nullable String sharedLocalId = DatastoreUtil.getOptionalProperty(
          entity, WAVELET_SHARED_LOCAL_ID_PROPERTY, String.class);
View Full Code Here


        }
        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

Related Classes of com.google.walkaround.proto.RobotSearchDigest

Copyright © 2018 www.massapicom. 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.