public class Dice
Manage random things.
| Modifier and Type | Field and Description |
|---|---|
static Dice |
INSTANCE
Manage random things.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
choose(java.util.List<? extends T> list)
Choose randomly an item in a list.
|
int |
index(java.util.Collection<?> col)
Return a random index in a Collection.
|
java.lang.String |
newId()
Return a new random Id.
|
int |
newInt(int max)
Return a random int between 0 and max (excluded).
|
public static Dice INSTANCE
Manage random things.
public <T> T choose(@NotNull
java.util.List<? extends T> list)
Choose randomly an item in a list.
public int index(@NotNull
java.util.Collection<?> col)
Return a random index in a Collection.
public int newInt(int max)
Return a random int between 0 and max (excluded).