Flutter Engine
The Flutter Engine
ExtractWidgetOptions.java
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
3 * for details. All rights reserved. Use of this source code is governed by a
4 * BSD-style license that can be found in the LICENSE file.
5 *
6 * This file has been automatically generated. Please do not edit it manually.
7 * To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files".
8 */
9package org.dartlang.analysis.server.protocol;
10
11import java.util.Arrays;
12import java.util.List;
13import java.util.Map;
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;
25
26/**
27 * @coverage dart.server.generated.types
28 */
29@SuppressWarnings("unused")
31
32 public static final ExtractWidgetOptions[] EMPTY_ARRAY = new ExtractWidgetOptions[0];
33
34 public static final List<ExtractWidgetOptions> EMPTY_LIST = Lists.newArrayList();
35
36 /**
37 * The name that the widget class should be given.
38 */
39 private String name;
40
41 /**
42 * Constructor for {@link ExtractWidgetOptions}.
43 */
44 public ExtractWidgetOptions(String name) {
45 this.name = name;
46 }
47
48 @Override
49 public boolean equals(Object obj) {
50 if (obj instanceof ExtractWidgetOptions) {
52 return
53 ObjectUtilities.equals(other.name, name);
54 }
55 return false;
56 }
57
58 public static ExtractWidgetOptions fromJson(JsonObject jsonObject) {
59 String name = jsonObject.get("name").getAsString();
60 return new ExtractWidgetOptions(name);
61 }
62
63 public static List<ExtractWidgetOptions> fromJsonArray(JsonArray jsonArray) {
64 if (jsonArray == null) {
65 return EMPTY_LIST;
66 }
67 ArrayList<ExtractWidgetOptions> list = new ArrayList<ExtractWidgetOptions>(jsonArray.size());
68 Iterator<JsonElement> iterator = jsonArray.iterator();
69 while (iterator.hasNext()) {
70 list.add(fromJson(iterator.next().getAsJsonObject()));
71 }
72 return list;
73 }
74
75 /**
76 * The name that the widget class should be given.
77 */
78 public String getName() {
79 return name;
80 }
81
82 @Override
83 public int hashCode() {
84 HashCodeBuilder builder = new HashCodeBuilder();
85 builder.append(name);
86 return builder.toHashCode();
87 }
88
89 /**
90 * The name that the widget class should be given.
91 */
92 public void setName(String name) {
93 this.name = name;
94 }
95
96 public JsonObject toJson() {
97 JsonObject jsonObject = new JsonObject();
98 jsonObject.addProperty("name", name);
99 return jsonObject;
100 }
101
102 @Override
103 public String toString() {
104 StringBuilder builder = new StringBuilder();
105 builder.append("[");
106 builder.append("name=");
107 builder.append(name);
108 builder.append("]");
109 return builder.toString();
110 }
111
112}
static ExtractWidgetOptions fromJson(JsonObject jsonObject)
static List< ExtractWidgetOptions > fromJsonArray(JsonArray jsonArray)
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32