Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceFileEdit.java

Issue 485213004: Generate a toJson method onto our generated types, int is now represented as the wrapped Integer in… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceFileEdit.java
diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceFileEdit.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceFileEdit.java
index dfed682e6f7b68187ad3f516f3fee6995dddcf14..d96874cb9857f27b95b5bd399975ef3613d229d1 100644
--- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceFileEdit.java
+++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceFileEdit.java
@@ -20,6 +20,9 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.google.dart.server.utilities.general.ObjectUtilities;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonPrimitive;
import org.apache.commons.lang3.StringUtils;
/**
@@ -78,6 +81,20 @@ public class SourceFileEdit {
return file;
}
+ public JsonObject toJson() {
+ // Create a JsonObject
+ JsonObject jsonObject = new JsonObject();
+
+ // file
+ jsonObject.addProperty("file", file);
+
+ // edits
+ // the type Object cannot be represented in JsonObject
+
+ // Return the JsonObject
+ return jsonObject;
+ }
+
@Override
public String toString() {
StringBuilder builder = new StringBuilder();

Powered by Google App Engine
This is Rietveld 408576698