Class BulkOperation

java.lang.Object
co.elastic.clients.elasticsearch.core.bulk.BulkOperation
All Implemented Interfaces:
JsonpSerializable, NdJsonpSerializable, TaggedUnion<BulkOperation.Kind,​java.lang.Object>

public class BulkOperation
extends java.lang.Object
implements TaggedUnion<BulkOperation.Kind,​java.lang.Object>, NdJsonpSerializable, JsonpSerializable
See Also:
API specification
  • Constructor Details

  • Method Details

    • _kind

      public final BulkOperation.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<BulkOperation.Kind,​java.lang.Object>
      Returns:
      the variant kind
    • _get

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<BulkOperation.Kind,​java.lang.Object>
    • of

      public static BulkOperation of​(java.util.function.Function<BulkOperation.Builder,​ObjectBuilder<BulkOperation>> fn)
    • _serializables

      public java.util.Iterator<?> _serializables()
      Specified by:
      _serializables in interface NdJsonpSerializable
    • isIndex

      public boolean isIndex()
      Is this variant instance of kind index?
    • index

      public <TDocument> IndexOperation<TDocument> index()
      Get the index variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the index kind.
    • isCreate

      public boolean isCreate()
      Is this variant instance of kind create?
    • create

      public <TDocument> CreateOperation<TDocument> create()
      Get the create variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the create kind.
    • isUpdate

      public boolean isUpdate()
      Is this variant instance of kind update?
    • update

      public <TDocument> UpdateOperation<TDocument> update()
      Get the update variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the update kind.
    • isDelete

      public boolean isDelete()
      Is this variant instance of kind delete?
    • delete

      public DeleteOperation delete()
      Get the delete variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the delete kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable