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")
40 private final String className;
45 private final String methodName;
50 private final boolean isDeclaration;
56 this.className = className;
57 this.methodName = methodName;
58 this.isDeclaration = isDeclaration;
66 ObjectUtilities.
equals(other.className, className) &&
67 ObjectUtilities.equals(other.methodName, methodName) &&
68 other.isDeclaration == isDeclaration;
74 String className = jsonObject.get(
"className") ==
null ? null : jsonObject.get(
"className").getAsString();
75 String methodName = jsonObject.get(
"methodName").getAsString();
76 boolean isDeclaration = jsonObject.get(
"isDeclaration").getAsBoolean();
81 if (jsonArray ==
null) {
84 ArrayList<InlineMethodFeedback> list =
new ArrayList<InlineMethodFeedback>(jsonArray.size());
85 Iterator<JsonElement> iterator = jsonArray.iterator();
86 while (iterator.hasNext()) {
87 list.add(fromJson(iterator.next().getAsJsonObject()));
104 return isDeclaration;
116 HashCodeBuilder
builder =
new HashCodeBuilder();
124 JsonObject jsonObject =
new JsonObject();
125 if (className !=
null) {
126 jsonObject.addProperty(
"className", className);
128 jsonObject.addProperty(
"methodName", methodName);
129 jsonObject.addProperty(
"isDeclaration", isDeclaration);
135 StringBuilder
builder =
new StringBuilder();
138 builder.append(className +
", ");
140 builder.append(methodName +
", ");
141 builder.append(
"isDeclaration=");
InlineMethodFeedback(String className, String methodName, boolean isDeclaration)
boolean equals(Object obj)
static List< InlineMethodFeedback > fromJsonArray(JsonArray jsonArray)
static InlineMethodFeedback fromJson(JsonObject jsonObject)