コード例 #1
0
 @Override
 public void fromJson(JsonObject json) {
   this.creationTime = json.getLong("creationTime", -1L);
   int status = json.getInt("status", WanSyncStatus.READY.getStatus());
   this.status = WanSyncStatus.getByStatus(status);
   this.syncedPartitionCount = json.getInt("syncedPartitionCount", 0);
   this.activeWanConfigName = json.getString("activeWanConfigName", null);
   this.activePublisherName = json.getString("activePublisherName", null);
 }
コード例 #2
0
 @Override
 public JsonObject toJson() {
   JsonObject root = new JsonObject();
   root.add("creationTime", creationTime);
   root.add("status", status.getStatus());
   root.add("syncedPartitionCount", syncedPartitionCount);
   if (activeWanConfigName != null) {
     root.add("activeWanConfigName", activeWanConfigName);
   }
   if (activePublisherName != null) {
     root.add("activePublisherName", activePublisherName);
   }
   return root;
 }