Class SmoothingModel
- java.lang.Object
-
- org.opensearch.client.opensearch.core.search.SmoothingModel
-
- All Implemented Interfaces:
JsonpSerializable
,TaggedUnion<SmoothingModel.Kind,java.lang.Object>
@JsonpDeserializable public class SmoothingModel extends java.lang.Object implements TaggedUnion<SmoothingModel.Kind,java.lang.Object>, JsonpSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SmoothingModel.Builder
static class
SmoothingModel.Kind
SmoothingModel
variant kinds.
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<SmoothingModel>
_DESERIALIZER
-
Constructor Summary
Constructors Constructor Description SmoothingModel(SmoothingModelVariant value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
_get()
SmoothingModel.Kind
_kind()
Get the of the kind of variant held by this object.boolean
isLaplace()
Is this variant instance of kindlaplace
?boolean
isLinearInterpolation()
Is this variant instance of kindlinear_interpolation
?boolean
isStupidBackoff()
Is this variant instance of kindstupid_backoff
?LaplaceSmoothingModel
laplace()
Get thelaplace
variant value.LinearInterpolationSmoothingModel
linearInterpolation()
Get thelinear_interpolation
variant value.static SmoothingModel
of(java.util.function.Function<SmoothingModel.Builder,ObjectBuilder<SmoothingModel>> fn)
void
serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
protected static void
setupSmoothingModelDeserializer(ObjectDeserializer<SmoothingModel.Builder> op)
StupidBackoffSmoothingModel
stupidBackoff()
Get thestupid_backoff
variant value.
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<SmoothingModel> _DESERIALIZER
-
-
Constructor Detail
-
SmoothingModel
public SmoothingModel(SmoothingModelVariant value)
-
-
Method Detail
-
_kind
public final SmoothingModel.Kind _kind()
Description copied from interface:TaggedUnion
Get the of the kind of variant held by this object.- Specified by:
_kind
in interfaceTaggedUnion<SmoothingModel.Kind,java.lang.Object>
- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_get
in interfaceTaggedUnion<SmoothingModel.Kind,java.lang.Object>
-
of
public static SmoothingModel of(java.util.function.Function<SmoothingModel.Builder,ObjectBuilder<SmoothingModel>> fn)
-
isLaplace
public boolean isLaplace()
Is this variant instance of kindlaplace
?
-
laplace
public LaplaceSmoothingModel laplace()
Get thelaplace
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thelaplace
kind.
-
isLinearInterpolation
public boolean isLinearInterpolation()
Is this variant instance of kindlinear_interpolation
?
-
linearInterpolation
public LinearInterpolationSmoothingModel linearInterpolation()
Get thelinear_interpolation
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thelinear_interpolation
kind.
-
isStupidBackoff
public boolean isStupidBackoff()
Is this variant instance of kindstupid_backoff
?
-
stupidBackoff
public StupidBackoffSmoothingModel stupidBackoff()
Get thestupid_backoff
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thestupid_backoff
kind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
- Specified by:
serialize
in interfaceJsonpSerializable
-
setupSmoothingModelDeserializer
protected static void setupSmoothingModelDeserializer(ObjectDeserializer<SmoothingModel.Builder> op)
-
-