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 ApproximateQuantileMethod
Returns aQuantileMethod
instance representing the "approximate" quantile method.static QuantileMethod
Creates aQuantileMethod
from aBsonValue
in situations when there is no builder method that better satisfies your needs.Converts this object toBsonValue
.
-
Method Details
-
approximate
Returns aQuantileMethod
instance representing the "approximate" quantile method.- Returns:
- The requested
QuantileMethod
.
-
of
Creates aQuantileMethod
from aBsonValue
in 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 equivalentQuantileMethod
s, though they may not be equal.QuantileMethod method1 = QuantileMethod.approximate(); QuantileMethod method2 = QuantileMethod.of(new BsonString("approximate"));
- Parameters:
method
- ABsonValue
representing the requiredQuantileMethod
.- Returns:
- The requested
QuantileMethod
.
-
toBsonValue
BsonValue toBsonValue()Converts this object toBsonValue
.- Returns:
- A
BsonValue
representing thisQuantileMethod
.
-