public class RandomUtils
extends java.lang.Object
shuffle(Object[])
Shuffling algorithm, Randomly permutes the specified array using a default source of
randomnessshuffle(Object[], int)
Shuffling algorithm, Randomly permutes the specified arrayshuffle(int[])
Shuffling algorithm, Randomly permutes the specified int array using a default source of
randomnessshuffle(int[], int)
Shuffling algorithm, Randomly permutes the specified int arraygetRandom(int)
get random int between 0 and maxgetRandom(int, int)
get random int between min and maxgetRandomCapitalLetters(int)
get a fixed-length random string, its a mixture of uppercase lettersgetRandomLetters(int)
get a fixed-length random string, its a mixture of uppercase and lowercase letters
getRandomLowerCaseLetters(int)
get a fixed-length random string, its a mixture of lowercase lettersgetRandomNumbers(int)
get a fixed-length random string, its a mixture of numbersgetRandomNumbersAndLetters(int)
get a fixed-length random string, its a mixture of uppercase, lowercase
letters and numbersgetRandom(String, int)
get a fixed-length random string, its a mixture of chars in sourcegetRandom(char[], int)
get a fixed-length random string, its a mixture of chars in sourceCharModifier and Type | Field and Description |
---|---|
static java.lang.String |
CAPITAL_LETTERS |
static java.lang.String |
LETTERS |
static java.lang.String |
LOWER_CASE_LETTERS |
static java.lang.String |
NUMBERS |
static java.lang.String |
NUMBERS_AND_LETTERS |
Constructor and Description |
---|
RandomUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getRandom(char[] sourceChar,
int length)
get a fixed-length random string, its a mixture of chars in sourceChar
|
static int |
getRandom(int max)
get random int between 0 and max
|
static int |
getRandom(int min,
int max)
get random int between min and max
|
static java.lang.String |
getRandom(java.lang.String source,
int length)
get a fixed-length random string, its a mixture of chars in source
|
static java.lang.String |
getRandomCapitalLetters(int length)
get a fixed-length random string, its a mixture of uppercase letters
|
static java.lang.String |
getRandomLetters(int length)
get a fixed-length random string, its a mixture of uppercase and lowercase letters
|
static java.lang.String |
getRandomLowerCaseLetters(int length)
get a fixed-length random string, its a mixture of lowercase letters
|
static java.lang.String |
getRandomNumbers(int length)
get a fixed-length random string, its a mixture of numbers
|
static java.lang.String |
getRandomNumbersAndLetters(int length)
get a fixed-length random string, its a mixture of uppercase, lowercase letters and numbers
|
static int[] |
shuffle(int[] intArray)
Shuffling algorithm, Randomly permutes the specified int array using a default source of randomness
|
static int[] |
shuffle(int[] intArray,
int shuffleCount)
Shuffling algorithm, Randomly permutes the specified int array
|
static boolean |
shuffle(java.lang.Object[] objArray)
Shuffling algorithm, Randomly permutes the specified array using a default source of randomness
|
static boolean |
shuffle(java.lang.Object[] objArray,
int shuffleCount)
Shuffling algorithm, Randomly permutes the specified array
|
public static final java.lang.String NUMBERS_AND_LETTERS
public static final java.lang.String NUMBERS
public static final java.lang.String LETTERS
public static final java.lang.String CAPITAL_LETTERS
public static final java.lang.String LOWER_CASE_LETTERS
public static java.lang.String getRandomNumbersAndLetters(int length)
length
- getRandom(String source, int length)
public static java.lang.String getRandomNumbers(int length)
length
- getRandom(String source, int length)
public static java.lang.String getRandomLetters(int length)
length
- getRandom(String source, int length)
public static java.lang.String getRandomCapitalLetters(int length)
length
- getRandom(String source, int length)
public static java.lang.String getRandomLowerCaseLetters(int length)
length
- getRandom(String source, int length)
public static java.lang.String getRandom(java.lang.String source, int length)
source
- length
- getRandom(char[] sourceChar, int length)
public static java.lang.String getRandom(char[] sourceChar, int length)
sourceChar
- length
- public static int getRandom(int max)
max
- public static int getRandom(int min, int max)
min
- max
- public static boolean shuffle(java.lang.Object[] objArray)
objArray
- public static boolean shuffle(java.lang.Object[] objArray, int shuffleCount)
objArray
- shuffleCount
- public static int[] shuffle(int[] intArray)
intArray
- public static int[] shuffle(int[] intArray, int shuffleCount)
intArray
- shuffleCount
-