Package org.opensearch.core.xcontent
Class XContentHelper
java.lang.Object
org.opensearch.core.xcontent.XContentHelper
Core XContent Helper Utilities
- Opensearch.internal:
-
Method Summary
Modifier and TypeMethodDescriptionstatic BytesReferencetoXContent(ToXContent toXContent, MediaType mediaType, boolean humanReadable) Deprecated.static BytesReferencetoXContent(ToXContent toXContent, MediaType mediaType, ToXContent.Params params, boolean humanReadable) Returns the bytes that represent the XContent output of the providedToXContentobject, using the providedMediaType.
-
Method Details
-
toXContent
@Deprecated public static BytesReference toXContent(ToXContent toXContent, MediaType mediaType, boolean humanReadable) throws IOException Deprecated.Returns the bytes that represent the XContent output of the providedToXContentobject, using the providedMediaType. Wraps the output into a new anonymous object according to the value returned by theToXContent.isFragment()method returns.- Throws:
IOException
-
toXContent
public static BytesReference toXContent(ToXContent toXContent, MediaType mediaType, ToXContent.Params params, boolean humanReadable) throws IOException Returns the bytes that represent the XContent output of the providedToXContentobject, using the providedMediaType. Wraps the output into a new anonymous object according to the value returned by theToXContent.isFragment()method returns.- Throws:
IOException
-