-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JsonArray now can return the List of JsonElement #1209
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,6 +372,15 @@ public boolean getAsBoolean() { | |
throw new IllegalStateException(); | ||
} | ||
|
||
/** | ||
* Returns this array as List of JsonElement | ||
* | ||
* @return this array as List of JsonElement | ||
*/ | ||
public List<JsonElement> getAsList() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about |
||
return elements; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm... Why? The idea of this metod is modify JsonArray by modifying List (for example for sorting).
We cannot convert Iterable to List without going over all elements. This is not optimal way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, i misunderstood the use case. |
||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
return (o == this) || (o instanceof JsonArray && ((JsonArray) o).elements.equals(elements)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant doc.