Module org.elasticsearch.server
Class ChunkedToXContentBuilder
java.lang.Object
org.elasticsearch.common.xcontent.ChunkedToXContentBuilder
- All Implemented Interfaces:
Iterator<ToXContent>
A fluent builder to create
Iterator<ToXContent>
objects-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend
(Iterator<? extends ToXContent> xContents) append
(ChunkedToXContent chunk) append
(ToXContent xContent) appendIfPresent
(ChunkedToXContent chunk) appendIfPresent
(ToXContent xContent) array
(String name, Iterator<? extends ToXContent> items) Creates an array namedname
, with the contents set by appending together the contents ofitems
array
(String name, Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an array namedname
, with the contents set by callingcreate
on each item returned byitems
array
(String name, Iterator<T> items, Function<? super T, ToXContent> create) Creates an array namedname
, with the contents set by appending together the return values ofcreate
called on each item returned byitems
array
(Iterator<? extends ToXContent> items) Creates an array with the contents set by appending together the contents ofitems
array
(Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an array, with the contents set by callingcreate
on each item returned byitems
array
(Iterator<T> items, Function<? super T, ToXContent> create) Creates an array, with the contents set by appending together the return values ofcreate
called on each item returned byitems
execute
(Consumer<ChunkedToXContentBuilder> consumer) Passes this object toconsumer
.field
(String name, ChunkedToXContent value) field
(String name, ToXContent value) forEach
(Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Adds chunks from an iterator.forEach
(Iterator<T> items, Function<? super T, ToXContent> create) Adds chunks from an iterator.void
forEachRemaining
(Consumer<? super ToXContent> action) boolean
hasNext()
next()
object
(String name, Consumer<ChunkedToXContentBuilder> contents) Creates an object namedname
, with the contents set bycontents
object
(String name, Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an object namedname
, with the contents set by callingcreate
on each item returned byitems
object
(String name, Iterator<T> items, Function<? super T, ToXContent> create) Creates an object namedname
, with the contents set by appending together the return values ofcreate
called on each item returned byitems
Creates an object namedname
, with the contents of each field set bymap
object
(Consumer<ChunkedToXContentBuilder> contents) Creates an object, with the contents set bycontents
object
(Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an object, with the contents set by callingcreate
on each item returned byitems
object
(Iterator<T> items, Function<? super T, ToXContent> create) Creates an object, with the contents set by appending together the return values ofcreate
called on each item returned byitems
Creates an object with the contents of each field set bymap
params()
xContentObject
(String name, Iterator<? extends ToXContent> contents) Creates an object namedname
, with the specifiedcontents
xContentObject
(String name, ChunkedToXContent contents) Creates an object namedname
, with the specifiedcontents
xContentObject
(String name, ToXContent contents) Creates an object namedname
, with the specifiedcontents
xContentObject
(Iterator<? extends ToXContent> contents) Creates an object, with the specifiedcontents
xContentObject
(ChunkedToXContent contents) Creates an object, with the specifiedcontents
xContentObject
(ToXContent contents) Creates an object, with the specifiedcontents
xContentObjectFieldObjects
(String name, Map<String, ? extends ToXContent> map) Creates an object namedname
, with the contents of each field each another object created from each entry inmap
xContentObjectFieldObjects
(Map<String, ? extends ToXContent> map) Creates an object with the contents of each field each another object created from each entry inmap
xContentObjectFields
(String name, Map<String, ? extends ToXContent> map) Creates an object namedname
, with the contents of each field created from each entry inmap
xContentObjectFields
(Map<String, ? extends ToXContent> map) Creates an object with the contents of each field created from each entry inmap
-
Constructor Details
-
ChunkedToXContentBuilder
-
-
Method Details
-
params
-
xContentObject
Creates an object, with the specifiedcontents
-
xContentObject
Creates an object namedname
, with the specifiedcontents
-
xContentObject
Creates an object, with the specifiedcontents
-
xContentObject
Creates an object namedname
, with the specifiedcontents
-
xContentObject
Creates an object, with the specifiedcontents
-
xContentObject
public ChunkedToXContentBuilder xContentObject(String name, Iterator<? extends ToXContent> contents) Creates an object namedname
, with the specifiedcontents
-
xContentObjectFields
Creates an object with the contents of each field created from each entry inmap
-
xContentObjectFields
public ChunkedToXContentBuilder xContentObjectFields(String name, Map<String, ? extends ToXContent> map) Creates an object namedname
, with the contents of each field created from each entry inmap
-
xContentObjectFieldObjects
Creates an object with the contents of each field each another object created from each entry inmap
-
xContentObjectFieldObjects
public ChunkedToXContentBuilder xContentObjectFieldObjects(String name, Map<String, ? extends ToXContent> map) Creates an object namedname
, with the contents of each field each another object created from each entry inmap
-
object
Creates an object, with the contents set bycontents
-
object
Creates an object namedname
, with the contents set bycontents
-
object
public <T> ChunkedToXContentBuilder object(Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an object, with the contents set by callingcreate
on each item returned byitems
-
object
public <T> ChunkedToXContentBuilder object(Iterator<T> items, Function<? super T, ToXContent> create) Creates an object, with the contents set by appending together the return values ofcreate
called on each item returned byitems
-
object
public <T> ChunkedToXContentBuilder object(String name, Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an object namedname
, with the contents set by callingcreate
on each item returned byitems
-
object
public <T> ChunkedToXContentBuilder object(String name, Iterator<T> items, Function<? super T, ToXContent> create) Creates an object namedname
, with the contents set by appending together the return values ofcreate
called on each item returned byitems
-
object
Creates an object with the contents of each field set bymap
-
object
Creates an object namedname
, with the contents of each field set bymap
-
array
-
array
public <T> ChunkedToXContentBuilder array(Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an array, with the contents set by callingcreate
on each item returned byitems
-
array
Creates an array with the contents set by appending together the contents ofitems
-
array
Creates an array, with the contents set by appending together the return values ofcreate
called on each item returned byitems
-
array
public <T> ChunkedToXContentBuilder array(String name, Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an array namedname
, with the contents set by callingcreate
on each item returned byitems
-
array
Creates an array namedname
, with the contents set by appending together the contents ofitems
-
array
public <T> ChunkedToXContentBuilder array(String name, Iterator<T> items, Function<? super T, ToXContent> create) Creates an array namedname
, with the contents set by appending together the return values ofcreate
called on each item returned byitems
-
field
-
field
-
field
-
field
-
field
-
field
-
field
-
field
-
field
-
field
-
field
-
field
-
execute
Passes this object toconsumer
.This may seem superfluous, but it allows callers to 'break out' into more declarative code inside the lambda, whilst maintaining the top-level fluent method calls.
-
forEach
public <T> ChunkedToXContentBuilder forEach(Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Adds chunks from an iterator. Each item is passed tocreate
to add chunks to this builder. -
forEach
public <T> ChunkedToXContentBuilder forEach(Iterator<T> items, Function<? super T, ToXContent> create) Adds chunks from an iterator. Each item is passed tocreate
, and the resultingToXContent
objects are added to this builder in order. -
append
-
append
-
append
-
appendIfPresent
-
appendIfPresent
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<ToXContent>
-
next
- Specified by:
next
in interfaceIterator<ToXContent>
-
forEachRemaining
- Specified by:
forEachRemaining
in interfaceIterator<ToXContent>
-