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 kind;
67 ObjectUtilities.
equals(other.kind, kind) &&
75 String kind = jsonObject.get(
"kind").getAsString();
76 int offset = jsonObject.get(
"offset").getAsInt();
77 int length = jsonObject.get(
"length").getAsInt();
82 if (jsonArray ==
null) {
85 ArrayList<FoldingRegion> list =
new ArrayList<FoldingRegion>(jsonArray.size());
86 Iterator<JsonElement> iterator = jsonArray.iterator();
87 while (iterator.hasNext()) {
88 list.add(fromJson(iterator.next().getAsJsonObject()));
116 HashCodeBuilder
builder =
new HashCodeBuilder();
124 JsonObject jsonObject =
new JsonObject();
125 jsonObject.addProperty(
"kind", kind);
126 jsonObject.addProperty(
"offset",
offset);
127 jsonObject.addProperty(
"length",
length);
133 StringBuilder
builder =
new StringBuilder();
static FoldingRegion fromJson(JsonObject jsonObject)
FoldingRegion(String kind, int offset, int length)
boolean equals(Object obj)
static List< FoldingRegion > fromJsonArray(JsonArray jsonArray)