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;
29@SuppressWarnings(
"unused")
39 private String returnType;
45 private boolean createGetter;
70 private boolean extractAll;
76 this.returnType = returnType;
77 this.createGetter = createGetter;
79 this.parameters = parameters;
80 this.extractAll = extractAll;
88 ObjectUtilities.
equals(other.returnType, returnType) &&
89 other.createGetter == createGetter &&
90 ObjectUtilities.equals(other.name,
name) &&
91 ObjectUtilities.equals(other.parameters, parameters) &&
92 other.extractAll == extractAll;
98 String returnType = jsonObject.get(
"returnType").getAsString();
99 boolean createGetter = jsonObject.get(
"createGetter").getAsBoolean();
100 String
name = jsonObject.get(
"name").getAsString();
102 boolean extractAll = jsonObject.get(
"extractAll").getAsBoolean();
107 if (jsonArray ==
null) {
110 ArrayList<ExtractMethodOptions> list =
new ArrayList<ExtractMethodOptions>(jsonArray.size());
111 Iterator<JsonElement> iterator = jsonArray.iterator();
112 while (iterator.hasNext()) {
113 list.add(fromJson(iterator.next().getAsJsonObject()));
166 HashCodeBuilder
builder =
new HashCodeBuilder();
180 this.createGetter = createGetter;
189 this.extractAll = extractAll;
211 this.parameters = parameters;
218 this.returnType = returnType;
222 JsonObject jsonObject =
new JsonObject();
223 jsonObject.addProperty(
"returnType", returnType);
224 jsonObject.addProperty(
"createGetter", createGetter);
225 jsonObject.addProperty(
"name",
name);
226 JsonArray jsonArrayParameters =
new JsonArray();
228 jsonArrayParameters.add(elt.toJson());
230 jsonObject.add(
"parameters", jsonArrayParameters);
231 jsonObject.addProperty(
"extractAll", extractAll);
237 StringBuilder
builder =
new StringBuilder();
240 builder.append(returnType +
", ");
241 builder.append(
"createGetter=");
242 builder.append(createGetter +
", ");
246 builder.append(StringUtils.join(parameters,
", ") +
", ");
static List< RefactoringMethodParameter > fromJsonArray(JsonArray jsonArray)
DEF_SWITCHES_START aot vmservice shared library name