Module json_values

Class JsInstantGen

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

public final class JsInstantGen extends Object implements fun.gen.Gen<JsInstant>
Represents a JsInstant generator. It can be created using the static factory methods biased and arbitrary or, if none of the previous suit your needs, from a double generator and the function map:

      import fun.gen.Gen;
      import jsonvalues.JsInstant;

      Gen<Instant> instantGen = seed -> () -> {...};
      Gen<JsInstant> jsInstantGen = gen.map(JsInstant::of)
      
  

Arbitrary generators produces uniformed distributions of values. Biased generators produces, with higher probability, potential problematic values that usually cause more bugs.

  • Method Details

    • biased

      public static fun.gen.Gen<JsInstant> biased()
    • arbitrary

      public static fun.gen.Gen<JsInstant> arbitrary()
    • arbitrary

      public static fun.gen.Gen<JsInstant> arbitrary(long min, long max)
    • arbitrary

      public static fun.gen.Gen<JsInstant> arbitrary(ZonedDateTime min, ZonedDateTime max)
    • biased

      public static fun.gen.Gen<JsInstant> biased(long min, long max)
    • apply

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