Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
org.dartlang.analysis.server.protocol.ExtractMethodOptions Class Reference
Inheritance diagram for org.dartlang.analysis.server.protocol.ExtractMethodOptions:
org.dartlang.analysis.server.protocol.RefactoringOptions

Public Member Functions

 ExtractMethodOptions (String returnType, boolean createGetter, String name, List< RefactoringMethodParameter > parameters, boolean extractAll)
 
boolean equals (Object obj)
 
boolean createGetter ()
 
boolean extractAll ()
 
String getName ()
 
List< RefactoringMethodParametergetParameters ()
 
String getReturnType ()
 
int hashCode ()
 
void setCreateGetter (boolean createGetter)
 
void setExtractAll (boolean extractAll)
 
void setName (String name)
 
void setParameters (List< RefactoringMethodParameter > parameters)
 
void setReturnType (String returnType)
 
JsonObject toJson ()
 
String toString ()
 
- Public Member Functions inherited from org.dartlang.analysis.server.protocol.RefactoringOptions
 RefactoringOptions ()
 
boolean equals (Object obj)
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static ExtractMethodOptions fromJson (JsonObject jsonObject)
 
static List< ExtractMethodOptionsfromJsonArray (JsonArray jsonArray)
 
static RefactoringOptions fromJson (JsonObject jsonObject)
 

Static Public Attributes

static final ExtractMethodOptions[] EMPTY_ARRAY = new ExtractMethodOptions[0]
 
static final List< ExtractMethodOptionsEMPTY_LIST = Lists.newArrayList()
 
- Static Public Attributes inherited from org.dartlang.analysis.server.protocol.RefactoringOptions
static final RefactoringOptions[] EMPTY_ARRAY = new RefactoringOptions[0]
 
static final List< RefactoringOptionsEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

@coverage dart.server.generated.types

Definition at line 30 of file ExtractMethodOptions.java.

Constructor & Destructor Documentation

◆ ExtractMethodOptions()

org.dartlang.analysis.server.protocol.ExtractMethodOptions.ExtractMethodOptions ( String  returnType,
boolean  createGetter,
String  name,
List< RefactoringMethodParameter parameters,
boolean  extractAll 
)
inline

Constructor for ExtractMethodOptions.

Definition at line 75 of file ExtractMethodOptions.java.

75 {
76 this.returnType = returnType;
77 this.createGetter = createGetter;
78 this.name = name;
79 this.parameters = parameters;
80 this.extractAll = extractAll;
81 }

Member Function Documentation

◆ createGetter()

boolean org.dartlang.analysis.server.protocol.ExtractMethodOptions.createGetter ( )
inline

True if a getter should be created rather than a method. It is an error if this field is true and the list of parameters is non-empty.

Definition at line 122 of file ExtractMethodOptions.java.

122 {
123 return createGetter;
124 }

◆ equals()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringOptions.

Definition at line 84 of file ExtractMethodOptions.java.

84 {
85 if (obj instanceof ExtractMethodOptions) {
87 return
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;
93 }
94 return false;
95 }
ExtractMethodOptions(String returnType, boolean createGetter, String name, List< RefactoringMethodParameter > parameters, boolean extractAll)

◆ extractAll()

boolean org.dartlang.analysis.server.protocol.ExtractMethodOptions.extractAll ( )
inline

True if all occurrences of the expression or statements should be replaced by an invocation of the method. The expression or statements used to initiate the refactoring will always be replaced.

Definition at line 131 of file ExtractMethodOptions.java.

131 {
132 return extractAll;
133 }

◆ fromJson()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringOptions.

Definition at line 97 of file ExtractMethodOptions.java.

97 {
98 String returnType = jsonObject.get("returnType").getAsString();
99 boolean createGetter = jsonObject.get("createGetter").getAsBoolean();
100 String name = jsonObject.get("name").getAsString();
101 List<RefactoringMethodParameter> parameters = RefactoringMethodParameter.fromJsonArray(jsonObject.get("parameters").getAsJsonArray());
102 boolean extractAll = jsonObject.get("extractAll").getAsBoolean();
103 return new ExtractMethodOptions(returnType, createGetter, name, parameters, extractAll);
104 }

◆ fromJsonArray()

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

Definition at line 106 of file ExtractMethodOptions.java.

106 {
107 if (jsonArray == null) {
108 return EMPTY_LIST;
109 }
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()));
114 }
115 return list;
116 }
static ExtractMethodOptions fromJson(JsonObject jsonObject)

◆ getName()

String org.dartlang.analysis.server.protocol.ExtractMethodOptions.getName ( )
inline

The name that the method should be given.

Definition at line 138 of file ExtractMethodOptions.java.

138 {
139 return name;
140 }

◆ getParameters()

List< RefactoringMethodParameter > org.dartlang.analysis.server.protocol.ExtractMethodOptions.getParameters ( )
inline

The parameters that should be defined for the method.

It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a NAMED parameter.

  • To change the order and/or update proposed parameters, add parameters with the same identifiers as proposed.
  • To add new parameters, omit their identifier.
  • To remove some parameters, omit them in this list.

Definition at line 153 of file ExtractMethodOptions.java.

153 {
154 return parameters;
155 }

◆ getReturnType()

String org.dartlang.analysis.server.protocol.ExtractMethodOptions.getReturnType ( )
inline

The return type that should be defined for the method.

Definition at line 160 of file ExtractMethodOptions.java.

160 {
161 return returnType;
162 }

◆ hashCode()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringOptions.

Definition at line 165 of file ExtractMethodOptions.java.

165 {
166 HashCodeBuilder builder = new HashCodeBuilder();
167 builder.append(returnType);
168 builder.append(createGetter);
169 builder.append(name);
170 builder.append(parameters);
171 builder.append(extractAll);
172 return builder.toHashCode();
173 }

◆ setCreateGetter()

void org.dartlang.analysis.server.protocol.ExtractMethodOptions.setCreateGetter ( boolean  createGetter)
inline

True if a getter should be created rather than a method. It is an error if this field is true and the list of parameters is non-empty.

Definition at line 179 of file ExtractMethodOptions.java.

179 {
180 this.createGetter = createGetter;
181 }

◆ setExtractAll()

void org.dartlang.analysis.server.protocol.ExtractMethodOptions.setExtractAll ( boolean  extractAll)
inline

True if all occurrences of the expression or statements should be replaced by an invocation of the method. The expression or statements used to initiate the refactoring will always be replaced.

Definition at line 188 of file ExtractMethodOptions.java.

188 {
189 this.extractAll = extractAll;
190 }

◆ setName()

void org.dartlang.analysis.server.protocol.ExtractMethodOptions.setName ( String  name)
inline

The name that the method should be given.

Definition at line 195 of file ExtractMethodOptions.java.

195 {
196 this.name = name;
197 }

◆ setParameters()

void org.dartlang.analysis.server.protocol.ExtractMethodOptions.setParameters ( List< RefactoringMethodParameter parameters)
inline

The parameters that should be defined for the method.

It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a NAMED parameter.

  • To change the order and/or update proposed parameters, add parameters with the same identifiers as proposed.
  • To add new parameters, omit their identifier.
  • To remove some parameters, omit them in this list.

Definition at line 210 of file ExtractMethodOptions.java.

210 {
211 this.parameters = parameters;
212 }

◆ setReturnType()

void org.dartlang.analysis.server.protocol.ExtractMethodOptions.setReturnType ( String  returnType)
inline

The return type that should be defined for the method.

Definition at line 217 of file ExtractMethodOptions.java.

217 {
218 this.returnType = returnType;
219 }

◆ toJson()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringOptions.

Definition at line 221 of file ExtractMethodOptions.java.

221 {
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();
227 for (RefactoringMethodParameter elt : parameters) {
228 jsonArrayParameters.add(elt.toJson());
229 }
230 jsonObject.add("parameters", jsonArrayParameters);
231 jsonObject.addProperty("extractAll", extractAll);
232 return jsonObject;
233 }

◆ toString()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringOptions.

Definition at line 236 of file ExtractMethodOptions.java.

236 {
237 StringBuilder builder = new StringBuilder();
238 builder.append("[");
239 builder.append("returnType=");
240 builder.append(returnType + ", ");
241 builder.append("createGetter=");
242 builder.append(createGetter + ", ");
243 builder.append("name=");
244 builder.append(name + ", ");
245 builder.append("parameters=");
246 builder.append(StringUtils.join(parameters, ", ") + ", ");
247 builder.append("extractAll=");
248 builder.append(extractAll);
249 builder.append("]");
250 return builder.toString();
251 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 32 of file ExtractMethodOptions.java.

◆ EMPTY_LIST

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

Definition at line 34 of file ExtractMethodOptions.java.


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