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;
29@SuppressWarnings(
"unused")
51 private final String elementKindName;
56 private final String oldName;
64 this.elementKindName = elementKindName;
65 this.oldName = oldName;
75 ObjectUtilities.equals(other.elementKindName, elementKindName) &&
76 ObjectUtilities.equals(other.oldName, oldName);
82 int offset = jsonObject.get(
"offset").getAsInt();
83 int length = jsonObject.get(
"length").getAsInt();
84 String elementKindName = jsonObject.get(
"elementKindName").getAsString();
85 String oldName = jsonObject.get(
"oldName").getAsString();
90 if (jsonArray ==
null) {
93 ArrayList<RenameFeedback> list =
new ArrayList<RenameFeedback>(jsonArray.size());
94 Iterator<JsonElement> iterator = jsonArray.iterator();
95 while (iterator.hasNext()) {
96 list.add(fromJson(iterator.next().getAsJsonObject()));
106 return elementKindName;
133 HashCodeBuilder
builder =
new HashCodeBuilder();
136 builder.append(elementKindName);
142 JsonObject jsonObject =
new JsonObject();
143 jsonObject.addProperty(
"offset",
offset);
144 jsonObject.addProperty(
"length",
length);
145 jsonObject.addProperty(
"elementKindName", elementKindName);
146 jsonObject.addProperty(
"oldName", oldName);
152 StringBuilder
builder =
new StringBuilder();
158 builder.append(
"elementKindName=");
159 builder.append(elementKindName +
", ");
static RenameFeedback fromJson(JsonObject jsonObject)
String getElementKindName()
static List< RenameFeedback > fromJsonArray(JsonArray jsonArray)
RenameFeedback(int offset, int length, String elementKindName, String oldName)
boolean equals(Object obj)