Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/org/json/JSONArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;


/**
Expand Down Expand Up @@ -2023,4 +2024,13 @@ private static JSONException wrongValueFormatException(
, cause);
}

/**
* Returns a sequential {@code Stream} with this JSONArray as its source.
*
* @return a sequential {@code Stream} over the elements in this JSONArray
*/
public Stream<Object> stream() {
return myArrayList.stream();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a toList() method available. We can call toList().stream().


}
Loading