Interface QuantileMethod

All Known Subinterfaces:
ApproximateQuantileMethod

@Sealed public interface QuantileMethod
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 Type
    Method
    Description
    Returns a QuantileMethod instance representing the "approximate" quantile method.
    of(org.bson.BsonValue method)
    Creates a QuantileMethod from a BsonValue in situations when there is no builder method that better satisfies your needs.
    org.bson.BsonValue
    Converts this object to BsonValue.
  • Method Details

    • approximate

      static ApproximateQuantileMethod approximate()
      Returns a QuantileMethod instance representing the "approximate" quantile method.
      Returns:
      The requested QuantileMethod.
    • of

      static QuantileMethod of(org.bson.BsonValue method)
      Creates a QuantileMethod from a BsonValue 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 equivalent QuantileMethods, though they may not be equal.

      
        QuantileMethod method1 = QuantileMethod.approximate();
        QuantileMethod method2 = QuantileMethod.of(new BsonString("approximate"));
       
      Parameters:
      method - A BsonValue representing the required QuantileMethod.
      Returns:
      The requested QuantileMethod.
    • toBsonValue

      org.bson.BsonValue toBsonValue()
      Converts this object to BsonValue.
      Returns:
      A BsonValue representing this QuantileMethod.