public final class JsBinaryGen extends Object implements fun.gen.Gen<JsBinary>
biased
and arbitrary
or, if none of the previous suit your
needs, from a bytes generator and the function map:
import fun.gen.Gen;
import jsonvalues.JsBinary;
Gen<byte[]> byteGen = seed -> () -> {...};
Gen<JsBinary> jsByteGen = gen.map(JsBinary::of)
Arbitrary generators produces uniformed distributions of values. Biased generators produces, with higher probability, potential problematic values that usually cause more bugs.
Modifier and Type | Method and Description |
---|---|
Supplier<JsBinary> |
apply(Random seed)
Returns a supplier from the specified seed that generates a new JsBinary each time it's called
|
static fun.gen.Gen<JsBinary> |
arbitrary(int minLength,
int maxLength) |
static fun.gen.Gen<JsBinary> |
biased(int minLength,
int maxLength) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static fun.gen.Gen<JsBinary> arbitrary(int minLength, int maxLength)
minLength
- minimum number of bytes (inclusive)maxLength
- maximum number of bytes (inclusive)public static fun.gen.Gen<JsBinary> biased(int minLength, int maxLength)
minLength
- minimum number of bytes (inclusive)maxLength
- maximum number of bytes (inclusive)Copyright © 2022. All rights reserved.