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")
42 private final String documentation;
47 private final String expression;
59 private final boolean isRequired;
67 private final boolean isSafeToUpdate;
72 private final String
name;
95 this.documentation = documentation;
96 this.expression = expression;
98 this.isRequired = isRequired;
99 this.isSafeToUpdate = isSafeToUpdate;
101 this.children = children;
102 this.editor = editor;
111 ObjectUtilities.
equals(other.documentation, documentation) &&
112 ObjectUtilities.equals(other.expression, expression) &&
114 other.isRequired == isRequired &&
115 other.isSafeToUpdate == isSafeToUpdate &&
116 ObjectUtilities.equals(other.name,
name) &&
117 ObjectUtilities.equals(other.children, children) &&
118 ObjectUtilities.equals(other.editor, editor) &&
119 ObjectUtilities.equals(other.value,
value);
125 String documentation = jsonObject.get(
"documentation") ==
null ? null : jsonObject.get(
"documentation").getAsString();
126 String expression = jsonObject.get(
"expression") ==
null ? null : jsonObject.get(
"expression").getAsString();
127 int id = jsonObject.get(
"id").getAsInt();
128 boolean isRequired = jsonObject.get(
"isRequired").getAsBoolean();
129 boolean isSafeToUpdate = jsonObject.get(
"isSafeToUpdate").getAsBoolean();
130 String
name = jsonObject.get(
"name").getAsString();
138 if (jsonArray ==
null) {
141 ArrayList<FlutterWidgetProperty> list =
new ArrayList<FlutterWidgetProperty>(jsonArray.size());
142 Iterator<JsonElement> iterator = jsonArray.iterator();
143 while (iterator.hasNext()) {
144 list.add(fromJson(iterator.next().getAsJsonObject()));
162 return documentation;
203 return isSafeToUpdate;
222 HashCodeBuilder
builder =
new HashCodeBuilder();
227 builder.append(isSafeToUpdate);
236 JsonObject jsonObject =
new JsonObject();
237 if (documentation !=
null) {
238 jsonObject.addProperty(
"documentation", documentation);
240 if (expression !=
null) {
241 jsonObject.addProperty(
"expression", expression);
243 jsonObject.addProperty(
"id",
id);
244 jsonObject.addProperty(
"isRequired", isRequired);
245 jsonObject.addProperty(
"isSafeToUpdate", isSafeToUpdate);
246 jsonObject.addProperty(
"name",
name);
247 if (children !=
null) {
248 JsonArray jsonArrayChildren =
new JsonArray();
250 jsonArrayChildren.add(elt.toJson());
252 jsonObject.add(
"children", jsonArrayChildren);
254 if (editor !=
null) {
255 jsonObject.add(
"editor", editor.
toJson());
258 jsonObject.add(
"value",
value.toJson());
265 StringBuilder
builder =
new StringBuilder();
267 builder.append(
"documentation=");
268 builder.append(documentation +
", ");
270 builder.append(expression +
", ");
274 builder.append(isRequired +
", ");
275 builder.append(
"isSafeToUpdate=");
276 builder.append(isSafeToUpdate +
", ");
280 builder.append(StringUtils.join(children,
", ") +
", ");
DEF_SWITCHES_START aot vmservice shared library name