Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
RemoveContentOverlay.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 * A directive to remove an existing file content overlay. After processing this directive, the
28 * file contents will once again be read from the file system.
29 *
30 * If this directive is used on a file that doesn't currently have a content overlay, it has no
31 * effect.
32 *
33 * @coverage dart.server.generated.types
34 */
35@SuppressWarnings("unused")
37
38 public static final RemoveContentOverlay[] EMPTY_ARRAY = new RemoveContentOverlay[0];
39
40 public static final List<RemoveContentOverlay> EMPTY_LIST = Lists.newArrayList();
41
42 private final String type;
43
44 /**
45 * Constructor for {@link RemoveContentOverlay}.
46 */
48 this.type = "remove";
49 }
50
51 @Override
52 public boolean equals(Object obj) {
53 if (obj instanceof RemoveContentOverlay) {
55 return
56 ObjectUtilities.equals(other.type, type);
57 }
58 return false;
59 }
60
61 public static RemoveContentOverlay fromJson(JsonObject jsonObject) {
62 String type = jsonObject.get("type").getAsString();
63 return new RemoveContentOverlay();
64 }
65
66 public static List<RemoveContentOverlay> fromJsonArray(JsonArray jsonArray) {
67 if (jsonArray == null) {
68 return EMPTY_LIST;
69 }
70 ArrayList<RemoveContentOverlay> list = new ArrayList<RemoveContentOverlay>(jsonArray.size());
71 Iterator<JsonElement> iterator = jsonArray.iterator();
72 while (iterator.hasNext()) {
73 list.add(fromJson(iterator.next().getAsJsonObject()));
74 }
75 return list;
76 }
77
78 public String getType() {
79 return type;
80 }
81
82 @Override
83 public int hashCode() {
84 HashCodeBuilder builder = new HashCodeBuilder();
85 builder.append(type);
86 return builder.toHashCode();
87 }
88
89 public JsonObject toJson() {
90 JsonObject jsonObject = new JsonObject();
91 jsonObject.addProperty("type", type);
92 return jsonObject;
93 }
94
95 @Override
96 public String toString() {
97 StringBuilder builder = new StringBuilder();
98 builder.append("[");
99 builder.append("type=");
100 builder.append(type);
101 builder.append("]");
102 return builder.toString();
103 }
104
105}
static List< RemoveContentOverlay > fromJsonArray(JsonArray jsonArray)
static RemoveContentOverlay fromJson(JsonObject jsonObject)