Enum XContentType

java.lang.Object
java.lang.Enum<XContentType>
org.opensearch.common.xcontent.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
    Enum Constant
    Description
    A CBOR based content type.
    A JSON based content type.
    The jackson based smile binary format.
    A YAML based content type.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
     
     
    Returns the enum constant of this type with the specified name.
    static XContentType[]
    Returns an array containing the constants of this enum type, in the order they are declared.
    void
    writeTo(org.opensearch.core.common.io.stream.StreamOutput output)
     

    Methods inherited from class java.lang.Enum

    clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.opensearch.core.xcontent.MediaType

    contentBuilder, contentBuilder, detectedXContent, detectedXContent, mediaType, mediaTypeWithoutParameters, subtype, typeWithSubtype, xContent
  • Enum Constant Details

    • JSON

      public static final XContentType JSON
      A JSON based content type.
    • SMILE

      public static final XContentType SMILE
      The jackson based smile binary format. Fast and compact binary format.
    • YAML

      public static final XContentType YAML
      A YAML based content type.
    • CBOR

      public static final XContentType CBOR
      A CBOR based content type.
  • Method Details

    • values

      public static XContentType[] 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

      public static XContentType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • index

      public int index()
    • type

      public String type()
      Specified by:
      type in interface org.opensearch.core.xcontent.MediaType
    • format

      public String format()
      Specified by:
      format in interface org.opensearch.core.xcontent.MediaType
    • writeTo

      public void writeTo(org.opensearch.core.common.io.stream.StreamOutput output) throws IOException
      Specified by:
      writeTo in interface org.opensearch.core.common.io.stream.Writeable
      Throws:
      IOException