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")
38 private final Boolean boolValue;
40 private final Double doubleValue;
42 private final Integer intValue;
44 private final String stringValue;
51 private final String expression;
57 this.boolValue = boolValue;
58 this.doubleValue = doubleValue;
59 this.intValue = intValue;
60 this.stringValue = stringValue;
61 this.enumValue = enumValue;
62 this.expression = expression;
70 ObjectUtilities.
equals(other.boolValue, boolValue) &&
71 ObjectUtilities.equals(other.doubleValue, doubleValue) &&
72 ObjectUtilities.equals(other.intValue, intValue) &&
73 ObjectUtilities.equals(other.stringValue, stringValue) &&
74 ObjectUtilities.equals(other.enumValue, enumValue) &&
75 ObjectUtilities.equals(other.expression, expression);
81 Boolean boolValue = jsonObject.get(
"boolValue") ==
null ? null : jsonObject.get(
"boolValue").getAsBoolean();
82 Double doubleValue = jsonObject.get(
"doubleValue") ==
null ? null : jsonObject.get(
"doubleValue").getAsDouble();
83 Integer intValue = jsonObject.get(
"intValue") ==
null ? null : jsonObject.get(
"intValue").getAsInt();
84 String stringValue = jsonObject.get(
"stringValue") ==
null ? null : jsonObject.get(
"stringValue").getAsString();
86 String expression = jsonObject.get(
"expression") ==
null ? null : jsonObject.get(
"expression").getAsString();
91 if (jsonArray ==
null) {
94 ArrayList<FlutterWidgetPropertyValue> list =
new ArrayList<FlutterWidgetPropertyValue>(jsonArray.size());
95 Iterator<JsonElement> iterator = jsonArray.iterator();
96 while (iterator.hasNext()) {
97 list.add(fromJson(iterator.next().getAsJsonObject()));
131 HashCodeBuilder
builder =
new HashCodeBuilder();
142 JsonObject jsonObject =
new JsonObject();
143 if (boolValue !=
null) {
144 jsonObject.addProperty(
"boolValue", boolValue);
146 if (doubleValue !=
null) {
147 jsonObject.addProperty(
"doubleValue", doubleValue);
149 if (intValue !=
null) {
150 jsonObject.addProperty(
"intValue", intValue);
152 if (stringValue !=
null) {
153 jsonObject.addProperty(
"stringValue", stringValue);
155 if (enumValue !=
null) {
156 jsonObject.add(
"enumValue", enumValue.
toJson());
158 if (expression !=
null) {
159 jsonObject.addProperty(
"expression", expression);
166 StringBuilder
builder =
new StringBuilder();
169 builder.append(boolValue +
", ");
170 builder.append(
"doubleValue=");
171 builder.append(doubleValue +
", ");
173 builder.append(intValue +
", ");
174 builder.append(
"stringValue=");
175 builder.append(stringValue +
", ");
177 builder.append(enumValue +
", ");