Returns a Collector that accumulates the input elements into a new array. @param elementType Type of an element in the array. @param The type of the input elements. @return a Collector which collects all the input elements into an array, in encounter order.
(final Class<O> elementType)
| 564 | * array, in encounter order. |
| 565 | */ |
| 566 | public static <O> Collector<O, ?, O[]> toArray(final Class<O> elementType) { |
| 567 | return new ArrayCollector<>(elementType); |
| 568 | } |
| 569 | |
| 570 | /** |
| 571 | * Constructs a new instance. |
no outgoing calls