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
type;
79 String
type = jsonObject.get(
"type").getAsString();
80 int offset = jsonObject.get(
"offset").getAsInt();
81 int length = jsonObject.get(
"length").getAsInt();
86 if (jsonArray ==
null) {
89 ArrayList<HighlightRegion> list =
new ArrayList<HighlightRegion>(jsonArray.size());
90 Iterator<JsonElement> iterator = jsonArray.iterator();
91 while (iterator.hasNext()) {
92 list.add(fromJson(iterator.next().getAsJsonObject()));
120 HashCodeBuilder
builder =
new HashCodeBuilder();
128 JsonObject jsonObject =
new JsonObject();
129 jsonObject.addProperty(
"type",
type);
130 jsonObject.addProperty(
"offset",
offset);
131 jsonObject.addProperty(
"length",
length);
137 StringBuilder
builder =
new StringBuilder();
HighlightRegion(String type, int offset, int length)
static List< HighlightRegion > fromJsonArray(JsonArray jsonArray)
boolean containsInclusive(int x)
boolean equals(Object obj)
static HighlightRegion fromJson(JsonObject jsonObject)