Modifier and Type | Method and Description |
---|---|
Gen<T> |
Arbitrary.apply(int size)
Returns a generator for objects of type T.
|
static Gen<Character> |
Gen.choose(char min,
char max)
Chooses a char between min and max, bounds inclusive and chars distributed according to the underlying random
number generator.
|
static <T extends Enum<T>> |
Gen.choose(Class<T> clazz)
Chooses an enum value from all the enum constants defined in the enumerated type.
|
static Gen<Double> |
Gen.choose(double min,
double max)
Chooses a double between min and max, bounds inclusive and numbers distributed according to the distribution
of the underlying random number generator.
|
static Gen<Integer> |
Gen.choose(int min,
int max)
Chooses an int between min and max, bounds inclusive and numbers distributed according to the distribution of
the underlying random number generator.
|
static <T> Gen<T> |
Gen.choose(Iterable<T> values)
Chooses a value from all values in the iterable
|
static Gen<Long> |
Gen.choose(long min,
long max)
Chooses a long between min and max, bounds inclusive and numbers distributed according to the distribution of
the underlying random number generator.
|
static <T> Gen<T> |
Gen.choose(T[] values)
Chooses a value from all values in the array.
|
static <T> Gen<T> |
Gen.fail()
A failing generator which throws a RuntimeException("failed").
|
static <T> Gen<T> |
Gen.fail(String message)
A failing generator which throws a RuntimeException.
|
default Gen<T> |
Gen.filter(Predicate<? super T> predicate)
Returns a generator based on this generator which produces values that fulfill the given predicate.
|
default <U> Gen<U> |
Gen.flatMap(Function<? super T,? extends Gen<? extends U>> mapper)
Maps generated Ts to Us.
|
static <T> Gen<T> |
Gen.frequency(Iterable<Tuple2<Integer,Gen<T>>> generators)
Chooses one of the given generators according to their frequency.
|
static <T> Gen<T> |
Gen.frequency(Tuple2<Integer,Gen<T>>... generators)
Chooses one of the given generators according to their frequency.
|
default <U> Gen<U> |
Gen.map(Function<? super T,? extends U> mapper)
Maps generated Ts to Us.
|
static <T> Gen<T> |
Gen.of(T t)
A generator which constantly returns t.
|
static <T> Gen<T> |
Gen.of(T seed,
Function<? super T,? extends T> next) |
static <T> Gen<T> |
Gen.oneOf(Gen<T>... generators)
Randomly chooses one of the given generators.
|
static <T> Gen<T> |
Gen.oneOf(Iterable<Gen<T>> generators)
Randomly chooses one of the given generators.
|
default Gen<T> |
Gen.peek(Consumer<? super T> action) |
Modifier and Type | Method and Description |
---|---|
static <T> Gen<T> |
Gen.oneOf(Gen<T>... generators)
Randomly chooses one of the given generators.
|
static Arbitrary<String> |
Arbitrary.string(Gen<Character> gen)
Generates arbitrary strings based on a given alphabet represented by gen.
|
Modifier and Type | Method and Description |
---|---|
default <U> Gen<U> |
Gen.flatMap(Function<? super T,? extends Gen<? extends U>> mapper)
Maps generated Ts to Us.
|
static <T> Gen<T> |
Gen.frequency(Iterable<Tuple2<Integer,Gen<T>>> generators)
Chooses one of the given generators according to their frequency.
|
static <T> Gen<T> |
Gen.oneOf(Iterable<Gen<T>> generators)
Randomly chooses one of the given generators.
|
default <U> U |
Gen.transform(Function<? super Gen<T>,? extends U> f)
Transforms this
Gen . |
Copyright © 2017. All Rights Reserved.