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;
31@SuppressWarnings(
"unused")
67 this.superclassMember = superclassMember;
68 this.interfaceMembers = interfaceMembers;
78 ObjectUtilities.equals(other.superclassMember, superclassMember) &&
79 ObjectUtilities.equals(other.interfaceMembers, interfaceMembers);
85 int offset = jsonObject.get(
"offset").getAsInt();
86 int length = jsonObject.get(
"length").getAsInt();
93 if (jsonArray ==
null) {
96 ArrayList<OverrideMember> list =
new ArrayList<OverrideMember>(jsonArray.size());
97 Iterator<JsonElement> iterator = jsonArray.iterator();
98 while (iterator.hasNext()) {
99 list.add(fromJson(iterator.next().getAsJsonObject()));
109 return interfaceMembers;
132 return superclassMember;
137 HashCodeBuilder
builder =
new HashCodeBuilder();
140 builder.append(superclassMember);
141 builder.append(interfaceMembers);
146 JsonObject jsonObject =
new JsonObject();
147 jsonObject.addProperty(
"offset",
offset);
148 jsonObject.addProperty(
"length",
length);
149 if (superclassMember !=
null) {
150 jsonObject.add(
"superclassMember", superclassMember.
toJson());
152 if (interfaceMembers !=
null) {
153 JsonArray jsonArrayInterfaceMembers =
new JsonArray();
155 jsonArrayInterfaceMembers.add(elt.toJson());
157 jsonObject.add(
"interfaceMembers", jsonArrayInterfaceMembers);
164 StringBuilder
builder =
new StringBuilder();
170 builder.append(
"superclassMember=");
171 builder.append(superclassMember +
", ");
172 builder.append(
"interfaceMembers=");
173 builder.append(StringUtils.join(interfaceMembers,
", "));
static OverriddenMember fromJson(JsonObject jsonObject)
static List< OverriddenMember > fromJsonArray(JsonArray jsonArray)
List< OverriddenMember > getInterfaceMembers()
static List< OverrideMember > fromJsonArray(JsonArray jsonArray)
OverriddenMember getSuperclassMember()
boolean equals(Object obj)
static OverrideMember fromJson(JsonObject jsonObject)
OverrideMember(int offset, int length, OverriddenMember superclassMember, List< OverriddenMember > interfaceMembers)