com.fasterxml.jackson.databind.util

## Class JacksonCollectors

- java.lang.Object
- - com.fasterxml.jackson.databind.util.JacksonCollectors

    public abstract class JacksonCollectors
    extends Object

Utility class that provides custom `Collector` implementations to support Stream operations.

This class is not meant to be instantiated and serves only as a utility class.

Since:
  2.18

### Constructor Summary

Constructors
Constructor and Description
`JacksonCollectors()`

### Method Summary

All Methods Static Methods Concrete Methods
`static Collector<JsonNode,ArrayNode,ArrayNode>` `toArrayNode()` Creates a `Collector` that collects `JsonNode` elements into an `ArrayNode`.
`static Collector<JsonNode,ArrayNode,ArrayNode>` `toArrayNode(JsonNodeCreator nodeCreator)` Creates a `Collector` that collects `JsonNode` elements into an `ArrayNode`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JacksonCollectors

    public JacksonCollectors()

### Method Detail

#### toArrayNode

    public static Collector<JsonNode,ArrayNode,ArrayNode> toArrayNode()

Creates a `Collector` that collects `JsonNode` elements into an `ArrayNode`.

This method uses a `JsonNodeFactory` to create an empty `ArrayNode` and then adds each `JsonNode` to it.

Short-cut to `toArrayNode(JsonNodeFactory.instance`}

Returns:
  a `Collector` that collects `JsonNode` elements into an `ArrayNode`

#### toArrayNode

    public static Collector<JsonNode,ArrayNode,ArrayNode> toArrayNode(JsonNodeCreator nodeCreator)

Creates a `Collector` that collects `JsonNode` elements into an `ArrayNode`.

This method uses a `JsonNodeFactory` to create an empty `ArrayNode` and then adds each `JsonNode` to it.

Parameters:
  `nodeCreator` - Factory for constructing `ArrayNode` to contain nodes in
Returns:
  a `Collector` that collects `JsonNode` elements into an `ArrayNode`