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

org.specs2.control.LazyValue.scala Maven / Gradle / Ivy

The newest version!
package org.specs2
package control

/**
 * This class simply encapsulates a lazy value which will be only evaluated once
 * @see org.specs2.specification.process.RandomSequentialExecution for an example of use
 */
case class LazyValue[T](t: () => T) {
  lazy val value = {
    t()
  }

  def execute: LazyValue[T] = {
    value
    this
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy