public final class RandomUtils extends Object
| Constructor and Description |
|---|
RandomUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getRandomItem(Collection<T> collection) |
static <T> T |
getRandomItem(T... items) |
static boolean |
nextBoolean() |
static Double |
nextDouble(int minNumber,
int maxNumber) |
static Integer |
nextInt(int minNumber,
int maxNumber) |
static Integer |
nextInt(String minNumber,
String maxNumber) |
static long |
nextLong(long minNumber,
long maxNumber) |
static String |
nextString(char[] chars,
int length) |
static String |
nextString(int length) |
public static Double nextDouble(int minNumber, int maxNumber)
public static Integer nextInt(int minNumber, int maxNumber)
minNumber - min value inclusivemaxNumber - max value inclusivepublic static Integer nextInt(String minNumber, String maxNumber)
minNumber - min value inclusivemaxNumber - max value inclusivepublic static boolean nextBoolean()
public static <T> T getRandomItem(Collection<T> collection)
collection - - collection to take a random elementpublic static <T> T getRandomItem(T... items)
items - - array to take a random elementpublic static long nextLong(long minNumber,
long maxNumber)
public static String nextString(char[] chars, int length)
public static String nextString(int length)
Copyright © 2022. All rights reserved.