Package org.pipservices3.commons.random
Class RandomArray
java.lang.Object
org.pipservices3.commons.random.RandomArray
Random generator for array objects.
### Example ###
int value1 = RandomArray.pick(new int []{1, 2, 3, 4}); // Possible result: 3
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RandomArray
public RandomArray()
-
-
Method Details
-
pick
public static <T> T pick(T[] values) Picks a random element from specified array.- Parameters:
values
- an array of any type- Returns:
- a randomly picked item.
-
pick
Picks a random element from specified array.- Parameters:
values
- an list of any type- Returns:
- a randomly picked item.
-