GenOrThrow

class GenOrThrow[T](val gen: Gen[T])(implicit evidence$1: ClassTag[T])

Provides the ability to convert a Gen into an Iterator

Type parameters:
T

the type of value produced by the generator

Value parameters:
gen

a generator of some kind

Deprecated
class Object
trait Matchable
class Any

Value members

Concrete methods

def iterator(implicit c: GenConfig): Iterator[T]
Throws:
EmptyGenSampleException

when samples cannot be generated after the given number of attempts

Deprecated methods

def getOrThrow(seed: Seed): T
Deprecated
def getOrThrow(attempts: Int): T

Get the next element from this generator using the default seed with the given number of retries.

Get the next element from this generator using the default seed with the given number of retries.

Throws:
EmptyGenSampleException

when samples cannot be generated after the given number of attempts

Deprecated
def getOrThrow: T
Throws:
EmptyGenSampleException

when samples cannot be generated after a default number of attempts

Deprecated
def getOrThrowPure(implicit c: GenConfig): T
See also:
Deprecated
def randomOrThrow()(implicit c: GenConfig): T
See also:
Deprecated
def toIterable(attempts: Int): Iterable[T]

Converts this generator into a lazy Iterable so that it can be converted into a collection.

Converts this generator into a lazy Iterable so that it can be converted into a collection.

Value parameters:
attempts

the number of attempts to try generating a sample before throwing an execption

Returns:

A lazy iterable that pulls from this generator or throws an exception

Throws:
EmptyGenSampleException

when a sample cannot be generated after the given number of attempts

Deprecated
Deprecated
def toIterator(attempts: Int): Iterator[T]

Converts this generator into an infinite Iterator for a more flexible pull-based API.

Converts this generator into an infinite Iterator for a more flexible pull-based API.

Value parameters:
attempts

the number of attempts to try generating a sample before throwing an execption

Returns:

An iterator that pulls from this generator or throws an exception

Throws:
EmptyGenSampleException

when samples cannot be generated after the given number of attempts

Deprecated
Deprecated
def tryGet(seed: Seed): Try[T]

Get the next element from this generator using the given seed and default size and number of retries.

Get the next element from this generator using the given seed and default size and number of retries.

Deprecated
def tryGet(attempts: Int): Try[T]

Try to get a non-empty sample for a given number of tries and return the resulting get attempts in a Try.

Try to get a non-empty sample for a given number of tries and return the resulting get attempts in a Try.

Value parameters:
attempts

the number of attempts to get a non-empty sample before returning a Failure.

Returns:

Either a non-empty sample or a Failure with information about what sample was tried.

Deprecated
def tryGet: Try[T]

Same as Try(gen.randomOrThrow())

Same as Try(gen.randomOrThrow())

Deprecated

Concrete fields

val gen: Gen[T]