Package jsonvalues.gen
Class JsBinaryGen
java.lang.Object
jsonvalues.gen.JsBinaryGen
- All Implemented Interfaces:
fun.gen.Gen<JsBinary>
,Function<RandomGenerator,
Supplier<JsBinary>>
Represents a JsBinary generator. It can be created using the static factory methods
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 produce uniformed distributions of values. Biased generators produces, with higher probability, potential problematic values that usually cause more bugs.
-
Method Summary
Modifier and TypeMethodDescriptionapply
(RandomGenerator seed) static fun.gen.Gen
<JsBinary> arbitrary
(int minLength, int maxLength) Returns an arbitrary JSON binary generator with a specified range of byte lengths.static fun.gen.Gen
<JsBinary> biased
(int minLength, int maxLength) Returns a biased JSON binary generator with a specified range of byte lengths.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface fun.gen.Gen
classify, classify, collect, collect, distinct, distinct, map, peek, sample, sample, sample, suchThat, suchThat, then
-
Method Details
-
arbitrary
Returns an arbitrary JSON binary generator with a specified range of byte lengths.- Parameters:
minLength
- The minimum number of bytes (inclusive).maxLength
- The maximum number of bytes (inclusive).- Returns:
- An arbitrary JSON binary generator.
-
biased
Returns a biased JSON binary generator with a specified range of byte lengths.- Parameters:
minLength
- The minimum number of bytes (inclusive).maxLength
- The maximum number of bytes (inclusive).- Returns:
- A biased JSON binary generator.
-
apply
- Specified by:
apply
in interfaceFunction<RandomGenerator,
Supplier<JsBinary>>
-