Package io.keikai.doc.collab.lib0
Class Random
- java.lang.Object
-
- io.keikai.doc.collab.lib0.Random
-
public class Random extends java.lang.ObjectRandom Utility
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ToneOf(T[] arr)Returns a random element from the provided array.static intuint32()Generates a random 31-bit unsigned integer.static longulong53()Generates a random 53-bit unsigned long.static java.lang.Stringuuidv4()Generates a random UUID (version 4).
-
-
-
Method Detail
-
uint32
public static int uint32()
Generates a random 31-bit unsigned integer.- Returns:
- A random 31-bit unsigned integer.
-
ulong53
public static long ulong53()
Generates a random 53-bit unsigned long.- Returns:
- A random 53-bit unsigned long.
-
oneOf
public static <T> T oneOf(T[] arr)
Returns a random element from the provided array.- Type Parameters:
T- The type of elements in the array.- Parameters:
arr- The array from which to pick a random element.- Returns:
- A random element from the array.
-
uuidv4
public static java.lang.String uuidv4()
Generates a random UUID (version 4).- Returns:
- A randomly generated UUID (version 4).
-
-