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;
32@SuppressWarnings(
"unused")
42 private final String
path;
47 private final String
prefix;
60 this.elements = elements;
69 ObjectUtilities.equals(other.prefix,
prefix) &&
70 ObjectUtilities.equals(other.elements, elements);
76 String
path = jsonObject.get(
"path").getAsString();
77 String
prefix = jsonObject.get(
"prefix").getAsString();
78 List<String> elements = JsonUtilities.decodeStringList(jsonObject.get(
"elements").getAsJsonArray());
83 if (jsonArray ==
null) {
86 ArrayList<ImportedElements> list =
new ArrayList<ImportedElements>(jsonArray.size());
87 Iterator<JsonElement> iterator = jsonArray.iterator();
88 while (iterator.hasNext()) {
89 list.add(fromJson(iterator.next().getAsJsonObject()));
117 HashCodeBuilder
builder =
new HashCodeBuilder();
125 JsonObject jsonObject =
new JsonObject();
126 jsonObject.addProperty(
"path",
path);
127 jsonObject.addProperty(
"prefix",
prefix);
128 JsonArray jsonArrayElements =
new JsonArray();
129 for (String elt : elements) {
130 jsonArrayElements.add(
new JsonPrimitive(elt));
132 jsonObject.add(
"elements", jsonArrayElements);
138 StringBuilder
builder =
new StringBuilder();
145 builder.append(StringUtils.join(elements,
", "));
static ImportedElements fromJson(JsonObject jsonObject)
static List< ImportedElements > fromJsonArray(JsonArray jsonArray)
boolean equals(Object obj)
ImportedElements(String path, String prefix, List< String > elements)
List< String > getElements()
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path