Package jsonvalues.gen
Class JsBigDecGen
- java.lang.Object
-
- jsonvalues.gen.JsBigDecGen
-
public final class JsBigDecGen extends Object implements fun.gen.Gen<JsBigDec>
Represents a JsBigDec generator. It can be created using the static factory methodsbiased
andarbitrary
or, if none of the previous suit your needs, from a decimal generator and the function map:import fun.gen.Gen; import jsonvalues.JsBigDec; Gen<BigDecimal> decGen = seed -> () -> {...}; Gen<JsBigDec> jsDecGen = gen.map(JsBigDec::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<JsBigDec>
apply(Random seed)
Returns a supplier from the specified seed that generates a new JsBigDec each time it's calledstatic fun.gen.Gen<JsBigDec>
arbitrary()
Returns a generator that produces values uniformly distributedstatic fun.gen.Gen<JsBigDec>
arbitrary(BigDecimal min, BigDecimal max)
Returns a generator that produces values uniformly distributed over a specified intervalstatic fun.gen.Gen<JsBigDec>
biased()
returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs.static fun.gen.Gen<JsBigDec>
biased(long min, long max)
returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs.static fun.gen.Gen<JsBigDec>
biased(BigDecimal min, BigDecimal max)
returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs.
-
-
-
Method Detail
-
biased
public static fun.gen.Gen<JsBigDec> biased()
returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs. These values are:-
Long.MIN_VALUE
-Integer.MIN_VALUE
-Short.MIN_VALUE
-Byte.MIN_VALUE
-BigDecimal.ZERO
-Long.MAX_VALUE
-Integer.MAX_VALUE
-Short.MAX_VALUE
-Byte.MAX_VALUE
- Returns:
- a biased JsBigDec generator
-
arbitrary
public static fun.gen.Gen<JsBigDec> arbitrary()
Returns a generator that produces values uniformly distributed- Returns:
- a JsBigDec generator
-
arbitrary
public static fun.gen.Gen<JsBigDec> arbitrary(BigDecimal min, BigDecimal 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 JsBigDec generator
-
biased
public static fun.gen.Gen<JsBigDec> biased(BigDecimal min, BigDecimal 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
-BigDecimal.ZERO
-Long.MAX_VALUE
-Integer.MAX_VALUE
-Short.MAX_VALUE
-Byte.MAX_VALUE
- Parameters:
min
- lower bound of the interval (inclusive)max
- upper bound of the interval (inclusive)- Returns:
- a biased JsBigDec generator
-
biased
public static fun.gen.Gen<JsBigDec> 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
-BigDecimal.ZERO
-Long.MAX_VALUE
-Integer.MAX_VALUE
-Short.MAX_VALUE
-Byte.MAX_VALUE
- Parameters:
min
- lower bound of the interval (inclusive)max
- upper bound of the interval (inclusive)- Returns:
- a biased JsBigDec generator
-
-