Package org.stubit.random
Class RandomNumber
java.lang.Object
org.stubit.random.RandomNumber
Generates random integers.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
RandomNumber.RandomNumberBuilder
implementation forInteger
sstatic class
RandomNumber.RandomNumberBuilder
implementation forLong
sstatic interface
Interface for any random number builder. -
Method Summary
Modifier and TypeMethodDescriptionstatic RandomNumber.RandomNumberBuilder<Long>
aLong()
static long
aLongBetween
(long minInclusive, long maxInclusive) static int
static long
anInt()
static int
anIntBetween
(int minInclusive, int maxInclusive) static int
static long
-
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
minInclusive
andmaxInclusive
-
aNegativeInt
public static int aNegativeInt()- Returns:
- a random integer between
Integer.MIN_VALUE
and -1
-
aPositiveInt
public static int aPositiveInt()- Returns:
- a random integer between 1 and
Integer.MAX_VALUE
- 1
-
anInt
- Returns:
- a
RandomNumber.RandomIntBuilder
withmin
Integer.MIN_VALUE
andmax
Integer.MAX_VALUE
- 1.
-
aLongBetween
public static long aLongBetween(long minInclusive, long maxInclusive) - Parameters:
minInclusive
- the minimum value (inclusive)maxInclusive
- the maximum value (inclusive)- Returns:
- a random long between
minInclusive
andmaxInclusive
-
aNegativeLong
public static long aNegativeLong()- Returns:
- a random long between
Long.MIN_VALUE
and -1
-
aPositiveLong
public static long aPositiveLong()- Returns:
- a random long between 1 and
Long.MAX_VALUE
- 1
-
aLong
- Returns:
- a
RandomNumber.RandomLongBuilder
withmin
Long.MIN_VALUE
andmax
Long.MAX_VALUE
- 1.
-