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;
40@SuppressWarnings(
"unused")
67 this.positions = positions;
69 this.suggestions = suggestions;
77 ObjectUtilities.
equals(other.positions, positions) &&
79 ObjectUtilities.equals(other.suggestions, suggestions);
86 int length = jsonObject.get(
"length").getAsInt();
92 if (jsonArray ==
null) {
95 ArrayList<LinkedEditGroup> list =
new ArrayList<LinkedEditGroup>(jsonArray.size());
96 Iterator<JsonElement> iterator = jsonArray.iterator();
97 while (iterator.hasNext()) {
98 list.add(fromJson(iterator.next().getAsJsonObject()));
127 HashCodeBuilder
builder =
new HashCodeBuilder();
135 JsonObject jsonObject =
new JsonObject();
136 JsonArray jsonArrayPositions =
new JsonArray();
138 jsonArrayPositions.add(elt.toJson());
140 jsonObject.add(
"positions", jsonArrayPositions);
141 jsonObject.addProperty(
"length",
length);
142 JsonArray jsonArraySuggestions =
new JsonArray();
144 jsonArraySuggestions.add(elt.toJson());
146 jsonObject.add(
"suggestions", jsonArraySuggestions);
152 StringBuilder
builder =
new StringBuilder();
155 builder.append(StringUtils.join(positions,
", ") +
", ");
158 builder.append(
"suggestions=");
159 builder.append(StringUtils.join(suggestions,
", "));
List< LinkedEditSuggestion > getSuggestions()
boolean equals(Object obj)
List< Position > getPositions()
static LinkedEditGroup fromJson(JsonObject jsonObject)
LinkedEditGroup(List< Position > positions, int length, List< LinkedEditSuggestion > suggestions)
static List< LinkedEditGroup > fromJsonArray(JsonArray jsonArray)
static List< LinkedEditSuggestion > fromJsonArray(JsonArray jsonArray)
static List< Position > fromJsonArray(JsonArray jsonArray)