toJsonArray

@NotNull
open fun toJsonArray(): @NotNull Collector<JsonElement, JsonArray, JsonArray>

Returns a Collector that accumulates JsonElements into a new JsonArray.

Example usage:


JsonArray jsonArray = elements.stream()
    .map(JsonObject::new)
    .collect(toJsonArray());

Return

a collector that gathers elements into a JsonArray

Since

3.7.0