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 String severity;
59 this.severity = severity;
61 this.location = location;
69 ObjectUtilities.
equals(other.severity, severity) &&
70 ObjectUtilities.equals(other.message,
message) &&
71 ObjectUtilities.equals(other.location, location);
77 String severity = jsonObject.get(
"severity").getAsString();
78 String
message = jsonObject.get(
"message").getAsString();
79 Location location = jsonObject.get(
"location") ==
null ? null :
Location.
fromJson(jsonObject.get(
"location").getAsJsonObject());
84 if (jsonArray ==
null) {
87 ArrayList<RefactoringProblem> list =
new ArrayList<RefactoringProblem>(jsonArray.size());
88 Iterator<JsonElement> iterator = jsonArray.iterator();
89 while (iterator.hasNext()) {
90 list.add(fromJson(iterator.next().getAsJsonObject()));
120 HashCodeBuilder
builder =
new HashCodeBuilder();
128 JsonObject jsonObject =
new JsonObject();
129 jsonObject.addProperty(
"severity", severity);
130 jsonObject.addProperty(
"message",
message);
131 if (location !=
null) {
132 jsonObject.add(
"location", location.
toJson());
139 StringBuilder
builder =
new StringBuilder();
142 builder.append(severity +
", ");
static Location fromJson(JsonObject jsonObject)
static List< RefactoringProblem > fromJsonArray(JsonArray jsonArray)
static RefactoringProblem fromJson(JsonObject jsonObject)
RefactoringProblem(String severity, String message, Location location)
boolean equals(Object obj)