Class Context
java.lang.Object
org.opensearch.client.opensearch.core.search.Context
- All Implemented Interfaces:
JsonpSerializable,PlainJsonSerializable,TaggedUnion<Context.Kind,Object>
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
public class Context
extends Object
implements TaggedUnion<Context.Kind,Object>, PlainJsonSerializable
Text or location that we want similar documents for or a lookup to a document's field for the text.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal Object_get()final Context.Kind_kind()Get the of the kind of variant held by this object.static Context.Builderbuilder()category()Get thecategoryvariant value.booleaninthashCode()booleanIs this variant instance of kindcategory?booleanIs this variant instance of kindlocation?location()Get thelocationvariant value.static Contextvoidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.client.json.PlainJsonSerializable
toJsonString
-
Field Details
-
_DESERIALIZER
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<Context.Kind,Object> - Returns:
- the variant kind
-
_get
- Specified by:
_getin interfaceTaggedUnion<Context.Kind,Object>
-
of
-
isCategory
public boolean isCategory()Is this variant instance of kindcategory? -
category
Get thecategoryvariant value.- Throws:
IllegalStateException- if the current variant is not thecategorykind.
-
isLocation
public boolean isLocation()Is this variant instance of kindlocation? -
location
Get thelocationvariant value.- Throws:
IllegalStateException- if the current variant is not thelocationkind.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-
toBuilder
-
builder
-
hashCode
public int hashCode() -
equals
-