9package org.dartlang.analysis.server.protocol;
11import java.util.Arrays;
14import com.google.common.collect.Lists;
15import com.google.dart.server.utilities.general.JsonUtilities;
16import com.google.dart.server.utilities.general.ObjectUtilities;
17import com.google.gson.JsonArray;
18import com.google.gson.JsonElement;
19import com.google.gson.JsonObject;
20import com.google.gson.JsonPrimitive;
21import org.apache.commons.lang3.builder.HashCodeBuilder;
22import java.util.ArrayList;
23import java.util.Iterator;
24import org.apache.commons.lang3.StringUtils;
41@SuppressWarnings(
"unused")
48 private final String
type;
69 ObjectUtilities.equals(other.edits, edits);
75 String
type = jsonObject.get(
"type").getAsString();
81 if (jsonArray ==
null) {
84 ArrayList<ChangeContentOverlay> list =
new ArrayList<ChangeContentOverlay>(jsonArray.size());
85 Iterator<JsonElement> iterator = jsonArray.iterator();
86 while (iterator.hasNext()) {
87 list.add(fromJson(iterator.next().getAsJsonObject()));
105 HashCodeBuilder
builder =
new HashCodeBuilder();
112 JsonObject jsonObject =
new JsonObject();
113 jsonObject.addProperty(
"type",
type);
114 JsonArray jsonArrayEdits =
new JsonArray();
116 jsonArrayEdits.add(elt.toJson());
118 jsonObject.add(
"edits", jsonArrayEdits);
124 StringBuilder
builder =
new StringBuilder();
129 builder.append(StringUtils.join(edits,
", "));
ChangeContentOverlay(List< SourceEdit > edits)
static List< ChangeContentOverlay > fromJsonArray(JsonArray jsonArray)
boolean equals(Object obj)
static ChangeContentOverlay fromJson(JsonObject jsonObject)
List< SourceEdit > getEdits()
static List< SourceEdit > fromJsonArray(JsonArray jsonArray)