Package org.opensearch.common.xcontent
Enum XContentType
- All Implemented Interfaces:
Serializable,Comparable<XContentType>,org.opensearch.core.common.io.stream.Writeable,org.opensearch.core.xcontent.MediaType
@PublicApi(since="1.0.0")
public enum XContentType
extends Enum<XContentType>
implements org.opensearch.core.xcontent.MediaType
The content type of
XContent.- Opensearch.api:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionformat()intindex()type()static XContentTypeReturns the enum constant of this type with the specified name.static XContentType[]values()Returns an array containing the constants of this enum type, in the order they are declared.voidwriteTo(org.opensearch.core.common.io.stream.StreamOutput output) Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface org.opensearch.core.xcontent.MediaType
contentBuilder, contentBuilder, detectedXContent, detectedXContent, mediaType, mediaTypeWithoutParameters, subtype, typeWithSubtype, xContent
-
Enum Constant Details
-
JSON
A JSON based content type. -
SMILE
The jackson based smile binary format. Fast and compact binary format. -
YAML
A YAML based content type. -
CBOR
A CBOR based content type.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
index
public int index() -
type
- Specified by:
typein interfaceorg.opensearch.core.xcontent.MediaType
-
format
- Specified by:
formatin interfaceorg.opensearch.core.xcontent.MediaType
-
writeTo
- Specified by:
writeToin interfaceorg.opensearch.core.common.io.stream.Writeable- Throws:
IOException
-