Package org.stubit.random
Class RandomInt
java.lang.Object
org.stubit.random.RandomInt
Generates random integers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilds a random integer within a specified range. -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic RandomInt.RandomIntBuilderanInt()static intanIntBetween(int minInclusive, int maxInclusive) static int
-
Method Details
-
anIntBetween
public static int anIntBetween(int minInclusive, int maxInclusive) - Parameters:
minInclusive- the minimum value (inclusive)maxInclusive- the maximum value (inclusive)- Returns:
- a random integer between
minInclusiveandmaxInclusive
-
aNegativeInt
public static int aNegativeInt()- Returns:
- a random integer between
Integer.MIN_VALUEand -1
-
aPositiveInt
public static int aPositiveInt()- Returns:
- a random integer between 1 and
Integer.MAX_VALUE- 1
-
anInt
- Returns:
- a
RandomInt.RandomIntBuilderwithminInteger.MIN_VALUEandmaxInteger.MAX_VALUE- 1.
-