Package jsonvalues.gen
Class JsBigDecGen
java.lang.Object
jsonvalues.gen.JsBigDecGen
Represents a JsBigDec generator. It can be created using the static factory methods
biased
and arbitrary
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
Modifier and TypeMethodDescriptionReturns a supplier from the specified seed that generates a new JsBigDec each time it's calledstatic fun.gen.Gen<JsBigDec>
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface fun.gen.Gen
map, peek, sample, sample, sample, suchThat, suchThat, then
-
Method Details
-
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
Returns a generator that produces values uniformly distributed- Returns:
- a JsBigDec generator
-
arbitrary
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
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
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
-
apply
Returns a supplier from the specified seed that generates a new JsBigDec each time it's called
-