Class JsBigIntGen

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

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

      import fun.gen.Gen;
      import jsonvalues.JsBigInt;

      Gen<BigInteger> bigIntGen = seed -> () -> {...};
      Gen<JsBigInt> jsBigIntGen = gen.map(JsBigInt::of)
      
  

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

  • Method Summary

    Modifier and Type
    Method
    Description
    apply(Random seed)
     
    static fun.gen.Gen<JsBigInt>
    arbitrary(int bits)
    Returns an arbitrary JSON big integer generator with a specified number of bits.
    static fun.gen.Gen<JsBigInt>
    biased(int bits)
    Returns a biased JSON big integer generator with a specified number of bits.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Function

    andThen, compose

    Methods inherited from interface fun.gen.Gen

    classify, classify, collect, collect, distinct, distinct, map, peek, sample, sample, sample, suchThat, suchThat, then
  • Method Details

    • arbitrary

      public static fun.gen.Gen<JsBigInt> arbitrary(int bits)
      Returns an arbitrary JSON big integer generator with a specified number of bits.
      Parameters:
      bits - The number of bits for the generated big integer.
      Returns:
      An arbitrary JSON big integer generator.
    • biased

      public static fun.gen.Gen<JsBigInt> biased(int bits)
      Returns a biased JSON big integer generator with a specified number of bits.
      Parameters:
      bits - The number of bits for the generated big integer.
      Returns:
      A biased JSON big integer generator.
    • apply

      public Supplier<JsBigInt> apply(Random seed)
      Specified by:
      apply in interface Function<Random,Supplier<JsBigInt>>