Create Java 8 Stream from ArrayNode

前端 未结 1 745
独厮守ぢ
独厮守ぢ 2021-02-12 06:11

Is it possible to create stream from com.fasterxml.jackson.databind.node.ArrayNode?
I tried:

ArrayNode files = (ArrayNode) json.get(\"files\")         


        
相关标签:
1条回答
  • 2021-02-12 07:01

    ArrayNode implements Iterable. Iterable has a spliterator() method. You can create a sequential Stream from a Spliterator using

    StreamSupport.stream(spliterator, false)
    
    0 讨论(0)
提交回复
热议问题