Class BulkOperation
- java.lang.Object
-
- org.opensearch.client.opensearch.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBulkOperation.Builderstatic classBulkOperation.KindBulkOperationvariant kinds.
-
Constructor Summary
Constructors Constructor Description BulkOperation(BulkOperationVariant value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object_get()BulkOperation.Kind_kind()Get the of the kind of variant held by this object.java.util.Iterator<?>_serializables()<TDocument>
CreateOperation<TDocument>create()Get thecreatevariant value.DeleteOperationdelete()Get thedeletevariant value.<TDocument>
IndexOperation<TDocument>index()Get theindexvariant value.booleanisCreate()Is this variant instance of kindcreate?booleanisDelete()Is this variant instance of kinddelete?booleanisIndex()Is this variant instance of kindindex?booleanisUpdate()Is this variant instance of kindupdate?static BulkOperationof(java.util.function.Function<BulkOperation.Builder,ObjectBuilder<BulkOperation>> fn)voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)<TDocument>
UpdateOperation<TDocument>update()Get theupdatevariant value.
-
-
-
Constructor Detail
-
BulkOperation
public BulkOperation(BulkOperationVariant value)
-
-
Method Detail
-
_kind
public final BulkOperation.Kind _kind()
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<BulkOperation.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_getin interfaceTaggedUnion<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:
_serializablesin interfaceNdJsonpSerializable
-
isIndex
public boolean isIndex()
Is this variant instance of kindindex?
-
index
public <TDocument> IndexOperation<TDocument> index()
Get theindexvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theindexkind.
-
isCreate
public boolean isCreate()
Is this variant instance of kindcreate?
-
create
public <TDocument> CreateOperation<TDocument> create()
Get thecreatevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thecreatekind.
-
isUpdate
public boolean isUpdate()
Is this variant instance of kindupdate?
-
update
public <TDocument> UpdateOperation<TDocument> update()
Get theupdatevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theupdatekind.
-
isDelete
public boolean isDelete()
Is this variant instance of kinddelete?
-
delete
public DeleteOperation delete()
Get thedeletevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thedeletekind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
-