object TestRandom extends Serializable
- Alphabetic
- By Inheritance
- TestRandom
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class Buffer(booleans: List[Boolean] = List.empty, bytes: List[Byte] = List.empty, chars: List[Char] = List.empty, doubles: List[Double] = List.empty, floats: List[Float] = List.empty, integers: List[Int] = List.empty, longs: List[Long] = List.empty, strings: List[String] = List.empty, uuids: List[UUID] = List.empty) extends Product with Serializable
The buffer of the
TestRandom
. - final case class Data(seed1: Int, seed2: Int, nextNextGaussians: scala.collection.immutable.Queue[Double] = Queue.empty) extends Product with Serializable
The seed of the
TestRandom
. - final case class Test(randomState: Atomic[Data], bufferState: Atomic[Buffer]) extends TestRandom with Product with Serializable
Adapted from @gzmo work in Scala.js (https://github.com/scala-js/scala-js/pull/780)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val DefaultData: Data
An arbitrary initial seed for the
TestRandom
. - val any: ZLayer[TestRandom, Nothing, TestRandom]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clearBooleans(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and clears the buffer of booleans. - def clearBytes(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and clears the buffer of bytes. - def clearChars(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and clears the buffer of characters. - def clearDoubles(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and clears the buffer of doubles. - def clearFloats(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and clears the buffer of floats. - def clearInts(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and clears the buffer of integers. - def clearLongs(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and clears the buffer of longs. - def clearStrings(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and clears the buffer of strings. - def clearUUIDs(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and clears the buffer of UUIDs. - def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val deterministic: Layer[Nothing, TestRandom]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def feedBooleans(booleans: Boolean*)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and feeds the buffer with the specified sequence of booleans. - def feedBytes(bytes: Chunk[Byte]*)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and feeds the buffer with the specified sequence of chunks of bytes. - def feedChars(chars: Char*)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and feeds the buffer with the specified sequence of characters. - def feedDoubles(doubles: Double*)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and feeds the buffer with the specified sequence of doubles. - def feedFloats(floats: Float*)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and feeds the buffer with the specified sequence of floats. - def feedInts(ints: Int*)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and feeds the buffer with the specified sequence of integers. - def feedLongs(longs: Long*)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and feeds the buffer with the specified sequence of longs. - def feedStrings(strings: String*)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and feeds the buffer with the specified sequence of strings. - def feedUUIDs(uuids: UUID*)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and feeds the buffer with the specified sequence of UUIDs. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getSeed(implicit trace: Trace): UIO[Long]
Accesses a
TestRandom
instance in the environment and gets the seed. - def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def make(data: Data): Layer[Nothing, TestRandom]
Constructs a new
TestRandom
with the specified initial state.Constructs a new
TestRandom
with the specified initial state. This can be useful for providing the required environment to an effect that requires aRandom
, such as withZIO#provide
. - def makeTest(data: Data)(implicit trace: Trace): UIO[Test]
Constructs a new
Test
object that implements theTestRandom
interface.Constructs a new
Test
object that implements theTestRandom
interface. This can be useful for mixing in with implementations of other interfaces. - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val random: ZLayer[Clock, Nothing, TestRandom]
- def save(implicit trace: Trace): UIO[UIO[Unit]]
Accesses a
TestRandom
instance in the environment and saves the random state in an effect which, when run, will restore theTestRandom
to the saved state. - def setSeed(seed: => Long)(implicit trace: Trace): UIO[Unit]
Accesses a
TestRandom
instance in the environment and sets the seed to the specified value. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()