blob: cf06cf6331acf9a111c22cdc093d077098573cf1 [file]
interface Node
internal class NodeImpl : Node
interface BsonNode : Node {
override fun toString(): String
}
abstract class AbstractBsonNode private constructor(
private val node: NodeImpl,
) : Node by node, BsonNode {
constructor() : this(NodeImpl())
final override fun toString(): String = "OK"
}
interface CompoundNode<N : Node>
interface CompoundBsonNode : BsonNode, CompoundNode<BsonNode>
abstract class AbstractCompoundBsonNode() : AbstractBsonNode(), CompoundBsonNode
//------
interface ValueOperators
interface ValueAccumulators<From : Any, Into : Any> : ValueOperators, CompoundBsonNode
interface ArithmeticValueAccumulators<From : Any, Into : Any> : ValueAccumulators<From, Into>
interface AggregationOperators : ValueOperators
interface AccumulationOperators<From : Any, Into : Any> : ValueAccumulators<From, Into>,
AggregationOperators,
ArithmeticValueAccumulators<From, Into>
internal class AccumulationOperatorsImpl<From : Any, Into : Any>(
) : AbstractCompoundBsonNode(),
AccumulationOperators<From, Into>
//------
internal fun <Document : Any, Out : Any> group() = AccumulationOperatorsImpl<Document, Out>()
fun box(): String {
return group<String, String>().toString()
}