Class NumberRandomizers
java.lang.Object
io.github.cjstehno.testthings.rando.NumberRandomizers
A collection of randomizers for generating numbers.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Randomizer<BigDecimal>
Builds a randomizer which will generate a randomBigDecimal
.static Randomizer<BigInteger>
Builds a randomizer which will generate a randomBigInteger
.static Randomizer<Boolean>
aBoolean()
A randomizer which will generate a random boolean value.static Randomizer<Byte>
aByte()
A randomizer which will generate a random byte value.static Randomizer<Double>
aDouble()
A randomizer which will generate a random double value.static Randomizer<Double>
aDoubleBetween
(double min, double max) Builds a randomizer which will generate a random double between the min (inclusive) and max (exclusive) bounds.static Randomizer<Float>
aFloat()
A randomizer which will generate a random float value.static Randomizer<Float>
aFloatBetween
(float min, float max) Builds a randomizer which will generate a random float between the min (inclusive) and max (exclusive) bounds.static Randomizer<Long>
aLong()
A randomizer which will generate a random long value.static Randomizer<Long>
aLongBetween
(long min, long max) Builds a randomizer which will generate a random long between the min (inclusive) and max (exclusive) bounds.static Randomizer<Integer>
anInt()
A randomizer which will generate a random int value.static Randomizer<Integer>
anIntBetween
(int min, int max) Builds a randomizer which will generate a random int between the min (inclusive) and max (exclusive) bounds.static Randomizer<Short>
aShort()
A randomizer which will generate a random short value.static Randomizer<byte[]>
byteArray
(int length) A randomizer which will generate a random byte array value.
-
Constructor Details
-
NumberRandomizers
public NumberRandomizers()
-
-
Method Details
-
anIntBetween
Builds a randomizer which will generate a random int between the min (inclusive) and max (exclusive) bounds.- Parameters:
min
- the min value (inclusive)max
- the max value (exclusive)- Returns:
- the randomizer
-
aLongBetween
Builds a randomizer which will generate a random long between the min (inclusive) and max (exclusive) bounds.- Parameters:
min
- the min value (inclusive)max
- the max value (exclusive)- Returns:
- the randomizer
-
aBigInteger
Builds a randomizer which will generate a randomBigInteger
.- Returns:
- the randomizer
-
aBigDecimal
Builds a randomizer which will generate a randomBigDecimal
.- Returns:
- the randomizer
-
aFloatBetween
Builds a randomizer which will generate a random float between the min (inclusive) and max (exclusive) bounds.- Parameters:
min
- the min value (inclusive)max
- the max value (exclusive)- Returns:
- the randomizer
-
aDoubleBetween
Builds a randomizer which will generate a random double between the min (inclusive) and max (exclusive) bounds.- Parameters:
min
- the min value (inclusive)max
- the max value (exclusive)- Returns:
- the randomizer
-
aBoolean
A randomizer which will generate a random boolean value.- Returns:
- the randomizer
-
anInt
A randomizer which will generate a random int value.- Returns:
- the randomizer
-
aShort
A randomizer which will generate a random short value.- Returns:
- the randomizer
-
aLong
A randomizer which will generate a random long value.- Returns:
- the randomizer
-
aDouble
A randomizer which will generate a random double value.- Returns:
- the randomizer
-
aFloat
A randomizer which will generate a random float value.- Returns:
- the randomizer
-
aByte
A randomizer which will generate a random byte value.- Returns:
- the randomizer
-
byteArray
A randomizer which will generate a random byte array value.- Parameters:
length
- the length of the byte array- Returns:
- the randomizer
-