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")
52 this.elements = elements;
53 this.imports = imports;
61 ObjectUtilities.
equals(other.elements, elements) &&
62 ObjectUtilities.equals(other.imports, imports);
74 if (jsonArray ==
null) {
77 ArrayList<ExistingImports> list =
new ArrayList<ExistingImports>(jsonArray.size());
78 Iterator<JsonElement> iterator = jsonArray.iterator();
79 while (iterator.hasNext()) {
80 list.add(fromJson(iterator.next().getAsJsonObject()));
101 HashCodeBuilder
builder =
new HashCodeBuilder();
108 JsonObject jsonObject =
new JsonObject();
109 jsonObject.add(
"elements", elements.
toJson());
110 JsonArray jsonArrayImports =
new JsonArray();
112 jsonArrayImports.add(elt.toJson());
114 jsonObject.add(
"imports", jsonArrayImports);
120 StringBuilder
builder =
new StringBuilder();
123 builder.append(elements +
", ");
125 builder.append(StringUtils.join(imports,
", "));
static List< ExistingImport > fromJsonArray(JsonArray jsonArray)
List< ExistingImport > getImports()
ImportedElementSet getElements()
static ExistingImports fromJson(JsonObject jsonObject)
static List< ExistingImports > fromJsonArray(JsonArray jsonArray)
ExistingImports(ImportedElementSet elements, List< ExistingImport > imports)
boolean equals(Object obj)
static ImportedElementSet fromJson(JsonObject jsonObject)