Class Context
java.lang.Object
co.elastic.clients.elasticsearch.core.search.Context
- All Implemented Interfaces:
JsonpSerializable
,TaggedUnion<Context.Kind,
Object>
@JsonpDeserializable
public class Context
extends Object
implements TaggedUnion<Context.Kind,Object>, JsonpSerializable
Text or location that we want similar documents for or a lookup to a
document's field for the text.
- See Also:
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Object
_get()
final Context.Kind
_kind()
Get the of the kind of variant held by this object.category()
Get thecategory
variant value.boolean
Is this variant instance of kindcategory
?boolean
Is this variant instance of kindlocation
?location()
Get thelocation
variant value.static Context
void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) toString()
-
Field Details
-
_DESERIALIZER
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnion
Get the of the kind of variant held by this object.- Specified by:
_kind
in interfaceTaggedUnion<Context.Kind,
Object> - Returns:
- the variant kind
-
_get
- Specified by:
_get
in interfaceTaggedUnion<Context.Kind,
Object>
-
of
-
isLocation
public boolean isLocation()Is this variant instance of kindlocation
? -
location
Get thelocation
variant value.- Throws:
IllegalStateException
- if the current variant is not of thelocation
kind.
-
isCategory
public boolean isCategory()Is this variant instance of kindcategory
? -
category
Get thecategory
variant value.- Throws:
IllegalStateException
- if the current variant is not of thecategory
kind.
-
serialize
- Specified by:
serialize
in interfaceJsonpSerializable
-
toString
-