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 ofitemsarray(String name, Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an array namedname, with the contents set by callingcreateon each item returned byitemsarray(String name, Iterator<T> items, Function<? super T, ToXContent> create) Creates an array namedname, with the contents set by appending together the return values ofcreatecalled on each item returned byitemsarray(Iterator<? extends ToXContent> items) Creates an array with the contents set by appending together the contents ofitemsarray(Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an array, with the contents set by callingcreateon each item returned byitemsarray(Iterator<T> items, Function<? super T, ToXContent> create) Creates an array, with the contents set by appending together the return values ofcreatecalled on each item returned byitemsexecute(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.voidforEachRemaining(Consumer<? super ToXContent> action) booleanhasNext()next()object(String name, Consumer<ChunkedToXContentBuilder> contents) Creates an object namedname, with the contents set bycontentsobject(String name, Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an object namedname, with the contents set by callingcreateon each item returned byitemsobject(String name, Iterator<T> items, Function<? super T, ToXContent> create) Creates an object namedname, with the contents set by appending together the return values ofcreatecalled on each item returned byitemsCreates an object namedname, with the contents of each field set bymapobject(Consumer<ChunkedToXContentBuilder> contents) Creates an object, with the contents set bycontentsobject(Iterator<T> items, BiConsumer<ChunkedToXContentBuilder, ? super T> create) Creates an object, with the contents set by callingcreateon each item returned byitemsobject(Iterator<T> items, Function<? super T, ToXContent> create) Creates an object, with the contents set by appending together the return values ofcreatecalled on each item returned byitemsCreates an object with the contents of each field set bymapparams()xContentObject(String name, Iterator<? extends ToXContent> contents) Creates an object namedname, with the specifiedcontentsxContentObject(String name, ChunkedToXContent contents) Creates an object namedname, with the specifiedcontentsxContentObject(String name, ToXContent contents) Creates an object namedname, with the specifiedcontentsxContentObject(Iterator<? extends ToXContent> contents) Creates an object, with the specifiedcontentsxContentObject(ChunkedToXContent contents) Creates an object, with the specifiedcontentsxContentObject(ToXContent contents) Creates an object, with the specifiedcontentsxContentObjectFieldObjects(String name, Map<String, ? extends ToXContent> map) Creates an object namedname, with the contents of each field each another object created from each entry inmapxContentObjectFieldObjects(Map<String, ? extends ToXContent> map) Creates an object with the contents of each field each another object created from each entry inmapxContentObjectFields(String name, Map<String, ? extends ToXContent> map) Creates an object namedname, with the contents of each field created from each entry inmapxContentObjectFields(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 callingcreateon 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 ofcreatecalled 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 callingcreateon 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 ofcreatecalled 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 callingcreateon 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 ofcreatecalled 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 callingcreateon 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 ofcreatecalled on each item returned byitems -
field
-
field
-
field
-
field
-
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 tocreateto 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 resultingToXContentobjects are added to this builder in order. -
append
-
append
-
append
-
appendIfPresent
-
appendIfPresent
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<ToXContent>
-
next
- Specified by:
nextin interfaceIterator<ToXContent>
-
forEachRemaining
- Specified by:
forEachRemainingin interfaceIterator<ToXContent>
-