Class JsLongGen

  • All Implemented Interfaces:
    fun.gen.Gen<JsLong>, Function<Random,​Supplier<JsLong>>

    public final class JsLongGen
    extends Object
    implements fun.gen.Gen<JsLong>
    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 long generator and the function map:
    
          import fun.gen.Gen;
          import jsonvalues.JsLong;
    
          Gen<Long> longGen = seed -> () -> {...};
          Gen<JsLong> jsLongGen = gen.map(JsLong::of)
          
      

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

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Supplier<JsLong> apply​(Random seed)
      Returns a supplier from the specified seed that generates a new JsLong each time it's called
      static fun.gen.Gen<JsLong> arbitrary()
      Returns a generator that produces values uniformly distributed
      static fun.gen.Gen<JsLong> arbitrary​(long min, long max)
      Returns a generator that produces values uniformly distributed over a specified interval
      static fun.gen.Gen<JsLong> biased()
      returns a biased generator that produces, with higher probability, potential problematic values that usually cause more bugs.
      static fun.gen.Gen<JsLong> biased​(long min, long max)
      returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs.
      • Methods inherited from interface fun.gen.Gen

        map, peek, sample, sample, sample, suchThat, suchThat, then
    • Method Detail

      • arbitrary

        public static fun.gen.Gen<JsLong> arbitrary()
        Returns a generator that produces values uniformly distributed
        Returns:
        a JsLong generator
      • arbitrary

        public static fun.gen.Gen<JsLong> arbitrary​(long min,
                                                    long max)
        Returns a generator that produces values uniformly distributed over a specified interval
        Parameters:
        min - lower bound of the interval (inclusive)
        max - upper bound of the interval (inclusive)
        Returns:
        a biased JsLong generator
      • biased

        public static fun.gen.Gen<JsLong> biased​(long min,
                                                 long max)
        returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs. These values are:
         - the lower bound of the interval
         - the upper bound of the interval
         
        and the following numbers provided that they are between the specified interval:
         - Long.MIN_VALUE
         - Integer.MIN_VALUE
         - Short.MIN_VALUE
         - Byte.MIN_VALUE
         - 0
         - Integer.MAX_VALUE
         - Short.MAX_VALUE
         - Byte.MAX_VALUE
         - Long.MAX_VALUE
         
        Parameters:
        min - lower bound of the interval (inclusive)
        max - upper bound of the interval (inclusive)
        Returns:
        a biased JsLong generator
      • apply

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