Package com.mongodb.client.model
Interface QuantileMethod
- All Known Subinterfaces:
ApproximateQuantileMethod
This interface represents a quantile method used in quantile accumulators of the
$group and
$setWindowFields stages.
It provides methods for creating and converting quantile methods to BsonValue.
- Since:
- 4.10
- See Also:
- Since server release
- 7.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ApproximateQuantileMethodReturns aQuantileMethodinstance representing the "approximate" quantile method.static QuantileMethodCreates aQuantileMethodfrom aBsonValuein situations when there is no builder method that better satisfies your needs.Converts this object toBsonValue.
-
Method Details
-
approximate
Returns aQuantileMethodinstance representing the "approximate" quantile method.- Returns:
- The requested
QuantileMethod.
-
of
Creates aQuantileMethodfrom aBsonValuein situations when there is no builder method that better satisfies your needs. This method cannot be used to validate the syntax.Example
The following code creates two functionally equivalentQuantileMethods, though they may not be equal.QuantileMethod method1 = QuantileMethod.approximate(); QuantileMethod method2 = QuantileMethod.of(new BsonString("approximate"));- Parameters:
method- ABsonValuerepresenting the requiredQuantileMethod.- Returns:
- The requested
QuantileMethod.
-
toBsonValue
BsonValue toBsonValue()Converts this object toBsonValue.- Returns:
- A
BsonValuerepresenting thisQuantileMethod.
-