Fluent builder for a JSON array, used together with MapBuilder to assemble nested document bodies such as Elasticsearch index requests. Elements are added via the inherited list methods, and startObject can be used to append a nested object built with MapBuilder. It is exported to GraalJS so app scripts can build arrays the same way as Java indexer code does.

Group: Builders

Extends: KillableList


Methods

startObject()

Returns: MapBuilder

Starts a new nested object, adds it as the next element of this array, and returns the new object builder so its fields can be set. Call endObject on the returned builder to go back to continuing this array.

endArray()

Returns: T

Finishes this array and returns the parent builder it was started from, so building can continue on the enclosing object or array.

duplicate()

Returns: ArrayBuilder<T>

Creates a deep copy of this array, recursively duplicating any nested MapBuilder, ESMappingsBuilder or ArrayBuilder elements it contains so the copy can be modified independently of the original.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.