All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.fehmicansaglam.tepkin.api.options.AggregationOptions.scala Maven / Gradle / Ivy

There is a newer version: 0.5
Show newest version
package net.fehmicansaglam.tepkin.api.options

import java.lang.{Boolean => JavaBoolean}

import net.fehmicansaglam.bson.BsonDocument

case class AggregationOptions(explain: Option[Boolean],
                              allowDiskUse: Option[Boolean],
                              cursor: Option[BsonDocument])

object AggregationOptions {

  class Builder {
    private var explain: Option[Boolean] = None
    private var allowDiskUse: Option[Boolean] = None
    private var cursor: Option[BsonDocument] = None

    def explain(explain: JavaBoolean): Builder = {
      this.explain = Some(explain)
      this
    }

    def allowDiskUse(allowDiskUse: JavaBoolean): Builder = {
      this.allowDiskUse = Some(allowDiskUse)
      this
    }

    def cursor(cursor: BsonDocument): Builder = {
      this.cursor = Some(cursor)
      this
    }

    def build(): AggregationOptions = AggregationOptions(explain, allowDiskUse, cursor)

  }

  def builder(): Builder = new Builder()

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy