diff --git a/src/main/java/org/json/JSONArray.java b/src/main/java/org/json/JSONArray.java index e2725b7a9..5ae51a0c6 100644 --- a/src/main/java/org/json/JSONArray.java +++ b/src/main/java/org/json/JSONArray.java @@ -14,6 +14,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.stream.Stream; /** @@ -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 stream() { + return myArrayList.stream(); + } + }