Class Context
java.lang.Object
co.elastic.clients.elasticsearch.core.search.Context
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<Context.Kind,java.lang.Object>
@JsonpDeserializable public class Context extends java.lang.Object implements TaggedUnion<Context.Kind,java.lang.Object>, JsonpSerializable
Text or location that we want similar documents for or a lookup to a
document's field for the text.
- See Also:
- Documentation on elastic.co, API specification
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContext.Builderstatic classContext.Kind -
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<Context>_DESERIALIZER -
Method Summary
Modifier and Type Method Description java.lang.Object_get()Context.Kind_kind()Get the of the kind of variant held by this object.java.lang.Stringcategory()Get thecategoryvariant value.booleanisCategory()Is this variant instance of kindcategory?booleanisLocation()Is this variant instance of kindlocation?GeoLocationlocation()Get thelocationvariant value.static Contextof(java.util.function.Function<Context.Builder,ObjectBuilder<Context>> fn)voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()- Specified by:
_getin interfaceTaggedUnion<Context.Kind,java.lang.Object>
-
of
-
isLocation
public boolean isLocation()Is this variant instance of kindlocation? -
location
Get thelocationvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thelocationkind.
-
isCategory
public boolean isCategory()Is this variant instance of kindcategory? -
category
public java.lang.String category()Get thecategoryvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thecategorykind.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-