Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
org.dartlang.analysis.server.protocol.ChangeContentOverlay Class Reference

Public Member Functions

 ChangeContentOverlay (List< SourceEdit > edits)
 
boolean equals (Object obj)
 
List< SourceEditgetEdits ()
 
String getType ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static ChangeContentOverlay fromJson (JsonObject jsonObject)
 
static List< ChangeContentOverlayfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final ChangeContentOverlay[] EMPTY_ARRAY = new ChangeContentOverlay[0]
 
static final List< ChangeContentOverlayEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A directive to modify an existing file content overlay. One or more ranges of text are deleted from the old file content overlay and replaced with new text.

The edits are applied in the order in which they occur in the list. This means that the offset of each edit must be correct under the assumption that all previous edits have been applied.

It is an error to use this overlay on a file that does not yet have a file content overlay or that has had its overlay removed via RemoveContentOverlay.

If any of the edits cannot be applied due to its offset or length being out of range, an INVALID_OVERLAY_CHANGE error will be reported.

@coverage dart.server.generated.types

Definition at line 42 of file ChangeContentOverlay.java.

Constructor & Destructor Documentation

◆ ChangeContentOverlay()

org.dartlang.analysis.server.protocol.ChangeContentOverlay.ChangeContentOverlay ( List< SourceEdit edits)
inline

Constructor for ChangeContentOverlay.

Definition at line 58 of file ChangeContentOverlay.java.

58 {
59 this.type = "change";
60 this.edits = edits;
61 }

Member Function Documentation

◆ equals()

boolean org.dartlang.analysis.server.protocol.ChangeContentOverlay.equals ( Object  obj)
inline

Definition at line 64 of file ChangeContentOverlay.java.

64 {
65 if (obj instanceof ChangeContentOverlay) {
67 return
68 ObjectUtilities.equals(other.type, type) &&
69 ObjectUtilities.equals(other.edits, edits);
70 }
71 return false;
72 }

◆ fromJson()

static ChangeContentOverlay org.dartlang.analysis.server.protocol.ChangeContentOverlay.fromJson ( JsonObject  jsonObject)
inlinestatic

Definition at line 74 of file ChangeContentOverlay.java.

74 {
75 String type = jsonObject.get("type").getAsString();
76 List<SourceEdit> edits = SourceEdit.fromJsonArray(jsonObject.get("edits").getAsJsonArray());
77 return new ChangeContentOverlay(edits);
78 }

◆ fromJsonArray()

static List< ChangeContentOverlay > org.dartlang.analysis.server.protocol.ChangeContentOverlay.fromJsonArray ( JsonArray  jsonArray)
inlinestatic

Definition at line 80 of file ChangeContentOverlay.java.

80 {
81 if (jsonArray == null) {
82 return EMPTY_LIST;
83 }
84 ArrayList<ChangeContentOverlay> list = new ArrayList<ChangeContentOverlay>(jsonArray.size());
85 Iterator<JsonElement> iterator = jsonArray.iterator();
86 while (iterator.hasNext()) {
87 list.add(fromJson(iterator.next().getAsJsonObject()));
88 }
89 return list;
90 }
static ChangeContentOverlay fromJson(JsonObject jsonObject)

◆ getEdits()

List< SourceEdit > org.dartlang.analysis.server.protocol.ChangeContentOverlay.getEdits ( )
inline

The edits to be applied to the file.

Definition at line 95 of file ChangeContentOverlay.java.

95 {
96 return edits;
97 }

◆ getType()

String org.dartlang.analysis.server.protocol.ChangeContentOverlay.getType ( )
inline

Definition at line 99 of file ChangeContentOverlay.java.

99 {
100 return type;
101 }

◆ hashCode()

int org.dartlang.analysis.server.protocol.ChangeContentOverlay.hashCode ( )
inline

Definition at line 104 of file ChangeContentOverlay.java.

104 {
105 HashCodeBuilder builder = new HashCodeBuilder();
106 builder.append(type);
107 builder.append(edits);
108 return builder.toHashCode();
109 }

◆ toJson()

JsonObject org.dartlang.analysis.server.protocol.ChangeContentOverlay.toJson ( )
inline

Definition at line 111 of file ChangeContentOverlay.java.

111 {
112 JsonObject jsonObject = new JsonObject();
113 jsonObject.addProperty("type", type);
114 JsonArray jsonArrayEdits = new JsonArray();
115 for (SourceEdit elt : edits) {
116 jsonArrayEdits.add(elt.toJson());
117 }
118 jsonObject.add("edits", jsonArrayEdits);
119 return jsonObject;
120 }

◆ toString()

String org.dartlang.analysis.server.protocol.ChangeContentOverlay.toString ( )
inline

Definition at line 123 of file ChangeContentOverlay.java.

123 {
124 StringBuilder builder = new StringBuilder();
125 builder.append("[");
126 builder.append("type=");
127 builder.append(type + ", ");
128 builder.append("edits=");
129 builder.append(StringUtils.join(edits, ", "));
130 builder.append("]");
131 return builder.toString();
132 }

Member Data Documentation

◆ EMPTY_ARRAY

final ChangeContentOverlay [] org.dartlang.analysis.server.protocol.ChangeContentOverlay.EMPTY_ARRAY = new ChangeContentOverlay[0]
static

Definition at line 44 of file ChangeContentOverlay.java.

◆ EMPTY_LIST

final List<ChangeContentOverlay> org.dartlang.analysis.server.protocol.ChangeContentOverlay.EMPTY_LIST = Lists.newArrayList()
static

Definition at line 46 of file ChangeContentOverlay.java.


The documentation for this class was generated from the following file: