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

org.scalameter.japi.ContextBuilder.scala Maven / Gradle / Ivy

The newest version!
package org.scalameter.japi

import org.scalameter.{Context, Key}


/** Builder for the [[org.scalameter.Context]] that constructs key from the path.
 *
 *  Note that it's mainly useful for the Java users.
 *  Scala users can simply directly access key containers and keys.
 */
class ContextBuilder {
  private val mapBuilder = Map.newBuilder[Key[_], Any]

  def put(key: String, value: Any): this.type = {
    mapBuilder += (Key.parseKey(key) -> value)
    this
  }

  def build(): Context = Context(mapBuilder.result())
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy