203 public CompletionSuggestion(String kind,
int relevance, String completion, String displayText, Integer replacementOffset, Integer replacementLength,
int selectionOffset,
int selectionLength,
boolean isDeprecated,
boolean isPotential, String docSummary, String docComplete, String declaringType, String defaultArgumentListString,
int[] defaultArgumentListTextRanges,
Element element, String returnType,
List<String> parameterNames,
List<String> parameterTypes, Integer requiredParameterCount, Boolean hasNamedParameters, String parameterName, String parameterType, String libraryUri, Boolean isNotImported) {
205 this.relevance = relevance;
206 this.completion = completion;
207 this.displayText = displayText;
208 this.replacementOffset = replacementOffset;
209 this.replacementLength = replacementLength;
210 this.selectionOffset = selectionOffset;
211 this.selectionLength = selectionLength;
212 this.isDeprecated = isDeprecated;
213 this.isPotential = isPotential;
214 this.docSummary = docSummary;
215 this.docComplete = docComplete;
216 this.declaringType = declaringType;
217 this.defaultArgumentListString = defaultArgumentListString;
218 this.defaultArgumentListTextRanges = defaultArgumentListTextRanges;
219 this.element = element;
220 this.returnType = returnType;
221 this.parameterNames = parameterNames;
222 this.parameterTypes = parameterTypes;
223 this.requiredParameterCount = requiredParameterCount;
224 this.hasNamedParameters = hasNamedParameters;
225 this.parameterName = parameterName;
226 this.parameterType = parameterType;
227 this.libraryUri = libraryUri;
228 this.isNotImported = isNotImported;
236 ObjectUtilities.
equals(other.kind, kind) &&
237 other.relevance == relevance &&
238 ObjectUtilities.equals(other.completion, completion) &&
239 ObjectUtilities.equals(other.displayText, displayText) &&
240 ObjectUtilities.equals(other.replacementOffset, replacementOffset) &&
241 ObjectUtilities.equals(other.replacementLength, replacementLength) &&
242 other.selectionOffset == selectionOffset &&
243 other.selectionLength == selectionLength &&
244 other.isDeprecated == isDeprecated &&
245 other.isPotential == isPotential &&
246 ObjectUtilities.equals(other.docSummary, docSummary) &&
247 ObjectUtilities.equals(other.docComplete, docComplete) &&
248 ObjectUtilities.equals(other.declaringType, declaringType) &&
249 ObjectUtilities.equals(other.defaultArgumentListString, defaultArgumentListString) &&
250 Arrays.equals(other.defaultArgumentListTextRanges, defaultArgumentListTextRanges) &&
251 ObjectUtilities.equals(other.element, element) &&
252 ObjectUtilities.equals(other.returnType, returnType) &&
253 ObjectUtilities.equals(other.parameterNames, parameterNames) &&
254 ObjectUtilities.equals(other.parameterTypes, parameterTypes) &&
255 ObjectUtilities.equals(other.requiredParameterCount, requiredParameterCount) &&
256 ObjectUtilities.equals(other.hasNamedParameters, hasNamedParameters) &&
257 ObjectUtilities.equals(other.parameterName, parameterName) &&
258 ObjectUtilities.equals(other.parameterType, parameterType) &&
259 ObjectUtilities.equals(other.libraryUri, libraryUri) &&
260 ObjectUtilities.equals(other.isNotImported, isNotImported);
266 String kind = jsonObject.get(
"kind").getAsString();
267 int relevance = jsonObject.get(
"relevance").getAsInt();
268 String completion = jsonObject.get(
"completion").getAsString();
269 String displayText = jsonObject.get(
"displayText") ==
null ? null : jsonObject.get(
"displayText").getAsString();
270 Integer replacementOffset = jsonObject.get(
"replacementOffset") ==
null ? null : jsonObject.get(
"replacementOffset").getAsInt();
271 Integer replacementLength = jsonObject.get(
"replacementLength") ==
null ? null : jsonObject.get(
"replacementLength").getAsInt();
272 int selectionOffset = jsonObject.get(
"selectionOffset").getAsInt();
273 int selectionLength = jsonObject.get(
"selectionLength").getAsInt();
274 boolean isDeprecated = jsonObject.get(
"isDeprecated").getAsBoolean();
275 boolean isPotential = jsonObject.get(
"isPotential").getAsBoolean();
276 String docSummary = jsonObject.get(
"docSummary") ==
null ? null : jsonObject.get(
"docSummary").getAsString();
277 String docComplete = jsonObject.get(
"docComplete") ==
null ? null : jsonObject.get(
"docComplete").getAsString();
278 String declaringType = jsonObject.get(
"declaringType") ==
null ? null : jsonObject.get(
"declaringType").getAsString();
279 String defaultArgumentListString = jsonObject.get(
"defaultArgumentListString") ==
null ? null : jsonObject.get(
"defaultArgumentListString").getAsString();
280 int[] defaultArgumentListTextRanges = jsonObject.get(
"defaultArgumentListTextRanges") ==
null ? null : JsonUtilities.decodeIntArray(jsonObject.get(
"defaultArgumentListTextRanges").getAsJsonArray());
281 Element element = jsonObject.get(
"element") ==
null ? null :
Element.
fromJson(jsonObject.get(
"element").getAsJsonObject());
282 String returnType = jsonObject.get(
"returnType") ==
null ? null : jsonObject.get(
"returnType").getAsString();
283 List<String> parameterNames = jsonObject.get(
"parameterNames") ==
null ? null : JsonUtilities.decodeStringList(jsonObject.get(
"parameterNames").getAsJsonArray());
284 List<String> parameterTypes = jsonObject.get(
"parameterTypes") ==
null ? null : JsonUtilities.decodeStringList(jsonObject.get(
"parameterTypes").getAsJsonArray());
285 Integer requiredParameterCount = jsonObject.get(
"requiredParameterCount") ==
null ? null : jsonObject.get(
"requiredParameterCount").getAsInt();
286 Boolean hasNamedParameters = jsonObject.get(
"hasNamedParameters") ==
null ? null : jsonObject.get(
"hasNamedParameters").getAsBoolean();
287 String parameterName = jsonObject.get(
"parameterName") ==
null ? null : jsonObject.get(
"parameterName").getAsString();
288 String parameterType = jsonObject.get(
"parameterType") ==
null ? null : jsonObject.get(
"parameterType").getAsString();
289 String libraryUri = jsonObject.get(
"libraryUri") ==
null ? null : jsonObject.get(
"libraryUri").getAsString();
290 Boolean isNotImported = jsonObject.get(
"isNotImported") ==
null ? null : jsonObject.get(
"isNotImported").getAsBoolean();
291 return new CompletionSuggestion(kind, relevance, completion, displayText, replacementOffset, replacementLength, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary, docComplete, declaringType, defaultArgumentListString, defaultArgumentListTextRanges, element, returnType, parameterNames, parameterTypes, requiredParameterCount, hasNamedParameters, parameterName, parameterType, libraryUri, isNotImported);
519 HashCodeBuilder builder =
new HashCodeBuilder();
520 builder.append(kind);
521 builder.append(relevance);
522 builder.append(completion);
523 builder.append(displayText);
524 builder.append(replacementOffset);
525 builder.append(replacementLength);
526 builder.append(selectionOffset);
527 builder.append(selectionLength);
528 builder.append(isDeprecated);
529 builder.append(isPotential);
530 builder.append(docSummary);
531 builder.append(docComplete);
532 builder.append(declaringType);
533 builder.append(defaultArgumentListString);
534 builder.append(defaultArgumentListTextRanges);
535 builder.append(element);
536 builder.append(returnType);
537 builder.append(parameterNames);
538 builder.append(parameterTypes);
539 builder.append(requiredParameterCount);
540 builder.append(hasNamedParameters);
541 builder.append(parameterName);
542 builder.append(parameterType);
543 builder.append(libraryUri);
544 builder.append(isNotImported);
545 return builder.toHashCode();
549 JsonObject jsonObject =
new JsonObject();
550 jsonObject.addProperty(
"kind", kind);
551 jsonObject.addProperty(
"relevance", relevance);
552 jsonObject.addProperty(
"completion", completion);
553 if (displayText !=
null) {
554 jsonObject.addProperty(
"displayText", displayText);
556 if (replacementOffset !=
null) {
557 jsonObject.addProperty(
"replacementOffset", replacementOffset);
559 if (replacementLength !=
null) {
560 jsonObject.addProperty(
"replacementLength", replacementLength);
562 jsonObject.addProperty(
"selectionOffset", selectionOffset);
563 jsonObject.addProperty(
"selectionLength", selectionLength);
564 jsonObject.addProperty(
"isDeprecated", isDeprecated);
565 jsonObject.addProperty(
"isPotential", isPotential);
566 if (docSummary !=
null) {
567 jsonObject.addProperty(
"docSummary", docSummary);
569 if (docComplete !=
null) {
570 jsonObject.addProperty(
"docComplete", docComplete);
572 if (declaringType !=
null) {
573 jsonObject.addProperty(
"declaringType", declaringType);
575 if (defaultArgumentListString !=
null) {
576 jsonObject.addProperty(
"defaultArgumentListString", defaultArgumentListString);
578 if (defaultArgumentListTextRanges !=
null) {
579 JsonArray jsonArrayDefaultArgumentListTextRanges =
new JsonArray();
580 for (
int elt : defaultArgumentListTextRanges) {
581 jsonArrayDefaultArgumentListTextRanges.add(
new JsonPrimitive(elt));
583 jsonObject.add(
"defaultArgumentListTextRanges", jsonArrayDefaultArgumentListTextRanges);
585 if (element !=
null) {
586 jsonObject.add(
"element", element.
toJson());
588 if (returnType !=
null) {
589 jsonObject.addProperty(
"returnType", returnType);
591 if (parameterNames !=
null) {
592 JsonArray jsonArrayParameterNames =
new JsonArray();
593 for (String elt : parameterNames) {
594 jsonArrayParameterNames.add(
new JsonPrimitive(elt));
596 jsonObject.add(
"parameterNames", jsonArrayParameterNames);
598 if (parameterTypes !=
null) {
599 JsonArray jsonArrayParameterTypes =
new JsonArray();
600 for (String elt : parameterTypes) {
601 jsonArrayParameterTypes.add(
new JsonPrimitive(elt));
603 jsonObject.add(
"parameterTypes", jsonArrayParameterTypes);
605 if (requiredParameterCount !=
null) {
606 jsonObject.addProperty(
"requiredParameterCount", requiredParameterCount);
608 if (hasNamedParameters !=
null) {
609 jsonObject.addProperty(
"hasNamedParameters", hasNamedParameters);
611 if (parameterName !=
null) {
612 jsonObject.addProperty(
"parameterName", parameterName);
614 if (parameterType !=
null) {
615 jsonObject.addProperty(
"parameterType", parameterType);
617 if (libraryUri !=
null) {
618 jsonObject.addProperty(
"libraryUri", libraryUri);
620 if (isNotImported !=
null) {
621 jsonObject.addProperty(
"isNotImported", isNotImported);
628 StringBuilder builder =
new StringBuilder();
630 builder.append(
"kind=");
631 builder.append(kind +
", ");
632 builder.append(
"relevance=");
633 builder.append(relevance +
", ");
634 builder.append(
"completion=");
635 builder.append(completion +
", ");
636 builder.append(
"displayText=");
637 builder.append(displayText +
", ");
638 builder.append(
"replacementOffset=");
639 builder.append(replacementOffset +
", ");
640 builder.append(
"replacementLength=");
641 builder.append(replacementLength +
", ");
642 builder.append(
"selectionOffset=");
643 builder.append(selectionOffset +
", ");
644 builder.append(
"selectionLength=");
645 builder.append(selectionLength +
", ");
646 builder.append(
"isDeprecated=");
647 builder.append(isDeprecated +
", ");
648 builder.append(
"isPotential=");
649 builder.append(isPotential +
", ");
650 builder.append(
"docSummary=");
651 builder.append(docSummary +
", ");
652 builder.append(
"docComplete=");
653 builder.append(docComplete +
", ");
654 builder.append(
"declaringType=");
655 builder.append(declaringType +
", ");
656 builder.append(
"defaultArgumentListString=");
657 builder.append(defaultArgumentListString +
", ");
658 builder.append(
"defaultArgumentListTextRanges=");
659 builder.append(StringUtils.join(defaultArgumentListTextRanges,
", ") +
", ");
660 builder.append(
"element=");
661 builder.append(element +
", ");
662 builder.append(
"returnType=");
663 builder.append(returnType +
", ");
664 builder.append(
"parameterNames=");
665 builder.append(StringUtils.join(parameterNames,
", ") +
", ");
666 builder.append(
"parameterTypes=");
667 builder.append(StringUtils.join(parameterTypes,
", ") +
", ");
668 builder.append(
"requiredParameterCount=");
669 builder.append(requiredParameterCount +
", ");
670 builder.append(
"hasNamedParameters=");
671 builder.append(hasNamedParameters +
", ");
672 builder.append(
"parameterName=");
673 builder.append(parameterName +
", ");
674 builder.append(
"parameterType=");
675 builder.append(parameterType +
", ");
676 builder.append(
"libraryUri=");
677 builder.append(libraryUri +
", ");
678 builder.append(
"isNotImported=");
679 builder.append(isNotImported);
681 return builder.toString();