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")
41 private final boolean isAnalyzing;
46 private final String analysisTarget;
52 this.isAnalyzing = isAnalyzing;
53 this.analysisTarget = analysisTarget;
61 other.isAnalyzing == isAnalyzing &&
62 ObjectUtilities.
equals(other.analysisTarget, analysisTarget);
68 boolean isAnalyzing = jsonObject.get(
"isAnalyzing").getAsBoolean();
69 String analysisTarget = jsonObject.get(
"analysisTarget") ==
null ? null : jsonObject.get(
"analysisTarget").getAsString();
74 if (jsonArray ==
null) {
77 ArrayList<AnalysisStatus> list =
new ArrayList<AnalysisStatus>(jsonArray.size());
78 Iterator<JsonElement> iterator = jsonArray.iterator();
79 while (iterator.hasNext()) {
80 list.add(fromJson(iterator.next().getAsJsonObject()));
89 return analysisTarget;
101 HashCodeBuilder
builder =
new HashCodeBuilder();
103 builder.append(analysisTarget);
108 JsonObject jsonObject =
new JsonObject();
109 jsonObject.addProperty(
"isAnalyzing", isAnalyzing);
110 if (analysisTarget !=
null) {
111 jsonObject.addProperty(
"analysisTarget", analysisTarget);
118 StringBuilder
builder =
new StringBuilder();
120 builder.append(
"isAnalyzing=");
121 builder.append(isAnalyzing +
", ");
122 builder.append(
"analysisTarget=");
123 builder.append(analysisTarget);
static List< AnalysisStatus > fromJsonArray(JsonArray jsonArray)
boolean equals(Object obj)
AnalysisStatus(boolean isAnalyzing, String analysisTarget)
String getAnalysisTarget()
static AnalysisStatus fromJson(JsonObject jsonObject)