object MockRandom extends Serializable
- Alphabetic
- By Inheritance
- MockRandom
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final case class Buffer(booleans: List[Boolean] = List.empty, bytes: List[Chunk[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) extends Product with Serializable
The buffer of the
MockRandom. - final case class Data(seed1: Int, seed2: Int, nextNextGaussians: scala.collection.immutable.Queue[Double] = Queue.empty) extends Product with Serializable
The seed of the
MockRandom. - case class Mock(randomState: Ref[Data], bufferState: Ref[Buffer]) extends Service[Any] with Product with Serializable
Adapted from @gzmo work in Scala.js (https://github.com/scala-js/scala-js/pull/780)
- trait Service[R] extends random.Random.Service[R]
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
MockRandom. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val clearBooleans: ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and clears the buffer of booleans. - val clearBytes: ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and clears the buffer of bytes. - val clearChars: ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and clears the buffer of characters. - val clearDoubles: ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and clears the buffer of doubles. - val clearFloats: ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and clears the buffer of floats. - val clearInts: ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and clears the buffer of integers. - val clearLongs: ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and clears the buffer of longs. - val clearStrings: ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and clears the buffer of strings. - def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def feedBooleans(booleans: Boolean*): ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and feeds the buffer with the specified sequence of booleans. - def feedBytes(bytes: Chunk[Byte]*): ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and feeds the buffer with the specified sequence of chunks of bytes. - def feedChars(chars: Char*): ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and feeds the buffer with the specified sequence of characters. - def feedDoubles(doubles: Double*): ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and feeds the buffer with the specified sequence of doubles. - def feedFloats(floats: Float*): ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and feeds the buffer with the specified sequence of floats. - def feedInts(ints: Int*): ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and feeds the buffer with the specified sequence of integers. - def feedLongs(longs: Long*): ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and feeds the buffer with the specified sequence of longs. - def feedStrings(strings: String*): ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance in the environment and feeds the buffer with the specified sequence of strings. - def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def make(data: Data): UIO[MockRandom]
Constructs a new
MockRandomwith the specified initial state.Constructs a new
MockRandomwith the specified initial state. This can be useful for providing the required environment to an effect that requires aRandom, such as with ZIO!.provide. - def makeMock(data: Data): UIO[Mock]
Constructs a new
Mockobject that implements theMockRandominterface.Constructs a new
Mockobject that implements theMockRandominterface. 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()
- def setSeed(seed: Long): ZIO[MockRandom, Nothing, Unit]
Accesses a
MockRandominstance 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()