Skip to content

Commit

Permalink
JsonArray now can return the List of JsonElement
Browse files Browse the repository at this point in the history
  • Loading branch information
ayarullin committed Dec 19, 2017
1 parent 6b20e3a commit ffb988a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gson/src/main/java/com/google/gson/JsonArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
return elements;
}

@Override
public boolean equals(Object o) {
return (o == this) || (o instanceof JsonArray && ((JsonArray) o).elements.equals(elements));
Expand Down

0 comments on commit ffb988a

Please sign in to comment.