Enum Class ChunkedToXContentHelper

java.lang.Object
java.lang.Enum<ChunkedToXContentHelper>
org.elasticsearch.common.xcontent.ChunkedToXContentHelper
All Implemented Interfaces:
Serializable, Comparable<ChunkedToXContentHelper>, Constable

public enum ChunkedToXContentHelper extends Enum<ChunkedToXContentHelper>
  • Method Details

    • values

      public static ChunkedToXContentHelper[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ChunkedToXContentHelper valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • startObject

      public static Iterator<ToXContent> startObject()
    • startObject

      public static Iterator<ToXContent> startObject(String name)
    • endObject

      public static Iterator<ToXContent> endObject()
    • startArray

      public static Iterator<ToXContent> startArray()
    • startArray

      public static Iterator<ToXContent> startArray(String name)
    • endArray

      public static Iterator<ToXContent> endArray()
    • object

      public static Iterator<ToXContent> object(String name, Map<String,?> map)
      Defines an object named name, with the contents of each field set by map
    • object

      public static <T> Iterator<ToXContent> object(String name, Map<String,T> map, Function<Map.Entry<String,T>,ToXContent> toXContent)
      Defines an object named name, with the contents set by calling toXContent on each entry in map
    • xContentObjectFields

      public static Iterator<ToXContent> xContentObjectFields(String name, Map<String,? extends ToXContent> map)
      Defines an object named name, with the contents of each field created from each entry in map
    • xContentObjectFieldObjects

      public static Iterator<ToXContent> xContentObjectFieldObjects(String name, Map<String,? extends ToXContent> map)
      Defines an object named name, with the contents of each field each another object created from each entry in map
    • field

      public static Iterator<ToXContent> field(String name, ChunkedToXContentObject value, ToXContent.Params params)
      Creates an Iterator to serialize a named field where the value is represented by a ChunkedToXContentObject. Chunked equivalent for XContentBuilder field(String name, ToXContent value)
      Parameters:
      name - name of the field
      value - value for this field
      params - params to propagate for XContent serialization
      Returns:
      Iterator composing field name and value serialization
    • array

      public static Iterator<ToXContent> array(String name, Iterator<? extends ToXContent> contents)
    • array

      public static <T> Iterator<ToXContent> array(Iterator<T> items, Function<T,ToXContent> toXContent)
    • array

      public static Iterator<ToXContent> array(String name, Iterator<? extends ChunkedToXContentObject> contents, ToXContent.Params params)
      Creates an Iterator to serialize a named field where the value is represented by an iterator of ChunkedToXContentObject. Chunked equivalent for XContentBuilder array(String name, ToXContent value)
      Parameters:
      name - name of the field
      contents - values for this field
      params - params to propagate for XContent serialization
      Returns:
      Iterator composing field name and value serialization
    • object

      public static Iterator<ToXContent> object(String name, Iterator<? extends ToXContent> iterator)
      Defines an object named name, with the contents set by iterator
    • chunk

      public static Iterator<ToXContent> chunk(ToXContent item)
      Creates an Iterator of a single ToXContent object that serializes the given object as a single chunk. Just wraps Iterators.single(T), but still useful because it avoids any type ambiguity.
      Parameters:
      item - Item to wrap
      Returns:
      Singleton iterator for the given item.