public abstract class ToXContentToBytes extends java.lang.Object implements ToXContent
ToXContent
implementation that also support conversion to BytesReference
for serialization purposesToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
ToXContentToBytes() |
protected |
ToXContentToBytes(XContentType defaultType) |
Modifier and Type | Method and Description |
---|---|
BytesReference |
buildAsBytes()
Returns a
BytesReference
containing the ToXContent output in binary format. |
BytesReference |
buildAsBytes(XContentType contentType)
Returns a
BytesReference
containing the ToXContent output in binary format. |
java.lang.String |
toString() |
java.lang.String |
toString(ToXContent.Params params) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFragment, toXContent
protected ToXContentToBytes()
protected ToXContentToBytes(XContentType defaultType)
public final BytesReference buildAsBytes()
BytesReference
containing the ToXContent
output in binary format.
Builds the request based on the default XContentType
, either Requests.CONTENT_TYPE
or provided as a constructor argumentpublic final BytesReference buildAsBytes(XContentType contentType)
BytesReference
containing the ToXContent
output in binary format.
Builds the request as the provided contentType
public final java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String toString(ToXContent.Params params)