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 produce uniformly distributed values. Biased generators produce, with higher probability, potential problematic values that usually cause more bugs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic fun.gen.Gen<JsBigDec>
Returns a generator that produces values uniformly distributed.static fun.gen.Gen<JsBigDec>
arbitrary
(long min, long max) Returns a generator that produces values uniformly distributed over a specified interval.static fun.gen.Gen<JsBigDec>
arbitrary
(BigDecimal min, BigDecimal max) Returns a generator that produces values uniformly distributed over a specified interval.static fun.gen.Gen<JsBigDec>
biased()
Returns a biased generator 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 generator 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 generator 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
classify, classify, collect, collect, distinct, distinct, map, peek, sample, sample, sample, suchThat, suchThat, then
-
Method Details
-
biased
Returns a biased generator 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
- The lower bound of the interval (inclusive).max
- The upper bound of the interval (inclusive).- Returns:
- A biased JsBigDec generator.
-
arbitrary
Returns a generator that produces values uniformly distributed over a specified interval.- Parameters:
min
- The lower bound of the interval (inclusive).max
- The upper bound of the interval (inclusive).- Returns:
- A biased JsBigDec generator.
-
biased
Returns a biased generator 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
- The lower bound of the interval (inclusive).max
- The upper bound of the interval (inclusive).- Returns:
- A biased JsBigDec generator.
-
biased
Returns a biased generator 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
- The lower bound of the interval (inclusive).max
- The upper bound of the interval (inclusive).- Returns:
- A biased JsBigDec generator.
-
apply
-