Class JsObjGen

java.lang.Object
jsonvalues.gen.JsObjGen
All Implemented Interfaces:
fun.gen.Gen<JsObj>, Function<RandomGenerator,Supplier<JsObj>>

public final class JsObjGen extends Object implements fun.gen.Gen<JsObj>
Represents a JsObj generator. It can be created using the static factory methods of or inserting new key-generator pairs to an existing JsObj generator with the method set(String, Gen). Each generator of the Json is created from a new seed that is calculated by passing the original one to the split generator

There are factory methods to create generators of up to 50-key Json objects.

Optional and nullable keys are specified with the methods setOptionals and setNullable.

Given the following optional fields a, b, and c, all the possible permutations (2^n = 8) are generated with the same probability:

  - a, b, and c missing
  - a and b missing
  - a and c missing
  - b and c missing
  - a missing
  - b missing
  - c missing
  - none of the missing
 

The same applies for nullable fields.