Class JsArrayGen

java.lang.Object
jsonvalues.gen.JsArrayGen
All Implemented Interfaces:
fun.gen.Gen<JsArray>, Function<Random,Supplier<JsArray>>

public final class JsArrayGen extends Object implements fun.gen.Gen<JsArray>
represent a JsArray generator. It can be created from the static factory methods biased and arbitrary, specifying an element generator that produces JsValue and the size of the array (either a bound interval or a fixed size).
  • Method Details

    • arbitrary

      public static fun.gen.Gen<JsArray> arbitrary(fun.gen.Gen<? extends JsValue> gen, int size)
      Parameters:
      gen - the element generator
      size - the size of the generated array
      Returns:
      a JsArray generator
    • arbitrary

      public static fun.gen.Gen<JsArray> arbitrary(fun.gen.Gen<? extends JsValue> gen, int minSize, int maxSize)
      Parameters:
      gen - the element generator
      minSize - the minimum size of the arrays
      maxSize - the maximum size of the arrays
      Returns:
      a JsArray generator
    • biased

      public static fun.gen.Gen<JsArray> biased(fun.gen.Gen<? extends JsValue> gen, int minSize, int maxSize)
      Parameters:
      gen - the element generator
      minSize - the minimum size of the arrays
      maxSize - the maximum size of the arrays
      Returns:
      a JsArray generator
    • apply

      public Supplier<JsArray> apply(Random seed)
      Returns a supplier from the specified seed that generates a new JsArray each time it's called
      Specified by:
      apply in interface Function<Random,Supplier<JsArray>>
      Parameters:
      seed - the generator seed
      Returns:
      a JsArray supplier