public class RandomUtils extends 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 sourceChar| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CAPITAL_LETTERS |
static String |
LETTERS |
static String |
LOWER_CASE_LETTERS |
static String |
NUMBERS |
static String |
NUMBERS_AND_LETTERS |
| 构造器和说明 |
|---|
RandomUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static 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 String |
getRandom(String source,
int length)
get a fixed-length random string, its a mixture of chars in source
|
static String |
getRandomCapitalLetters(int length)
get a fixed-length random string, its a mixture of uppercase letters
|
static String |
getRandomLetters(int length)
get a fixed-length random string, its a mixture of uppercase and lowercase letters
|
static String |
getRandomLowerCaseLetters(int length)
get a fixed-length random string, its a mixture of lowercase letters
|
static String |
getRandomNumbers(int length)
get a fixed-length random string, its a mixture of numbers
|
static 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(Object[] objArray)
Shuffling algorithm, Randomly permutes the specified array using a default source of randomness
|
static boolean |
shuffle(Object[] objArray,
int shuffleCount)
Shuffling algorithm, Randomly permutes the specified array
|
public static String getRandomNumbersAndLetters(int length)
length - getRandom(String source, int length)public static String getRandomNumbers(int length)
length - getRandom(String source, int length)public static String getRandomLetters(int length)
length - getRandom(String source, int length)public static String getRandomCapitalLetters(int length)
length - getRandom(String source, int length)public static String getRandomLowerCaseLetters(int length)
length - getRandom(String source, int length)public static String getRandom(String source, int length)
source - length - getRandom(char[] sourceChar, int length)public static 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(Object[] objArray)
objArray - public static boolean shuffle(Object[] objArray, int shuffleCount)
objArray - shuffleCount - public static int[] shuffle(int[] intArray)
intArray - public static int[] shuffle(int[] intArray,
int shuffleCount)
intArray - shuffleCount - Copyright © 2012-2014. All Rights Reserved.