Class RandomUtil
java.lang.Object
org.apache.activemq.artemis.utils.RandomUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Randomstatic StringrandomAlphaNumericString(int length) Utility method to build aStringfilled with random alpha-numeric characters.static booleanstatic ActiveMQBufferrandomBuffer(int size, long... data) static bytestatic byte[]static byte[]randomBytes(int length) static charUtility method to get a random alpha-numeric character.static doublestatic floatstatic intstatic intrandomInterval(int min, int max) static longstatic intrandomMax(int max) static intstatic intstatic Integerstatic longstatic shortstatic SimpleStringReturns A randomly generatedUUIDconverted to aSimpleString.static StringReturns A randomly generatedUUIDconverted to aString.
-
Field Details
-
random
-
-
Constructor Details
-
RandomUtil
public RandomUtil()
-
-
Method Details
-
getRandom
-
randomAlphaNumericString
Utility method to build aStringfilled with random alpha-numeric characters. TheStringwill contain characters from the following:- abcdefghijklmnopqrstuvwxyz
- ABCDEFGHIJKLMNOPQRSTUVWXYZ
- 0123456789
- Parameters:
length- how long the returnedStringshould be- Returns:
- a
Stringof random alpha-numeric characters
-
randomUUIDString
Returns A randomly generatedUUIDconverted to aString.- Returns:
- A randomly generated
UUIDconverted to aString
-
randomUUIDSimpleString
Returns A randomly generatedUUIDconverted to aSimpleString.- Returns:
- A randomly generated
UUIDconverted to aSimpleString
-
randomChar
public static char randomChar()Utility method to get a random alpha-numeric character. Thecharwill be one of the following:- abcdefghijklmnopqrstuvwxyz
- ABCDEFGHIJKLMNOPQRSTUVWXYZ
- 0123456789
- Returns:
- A randomly generated alpha-numeric
char
-
randomLong
public static long randomLong() -
randomPositiveLong
public static long randomPositiveLong() -
randomInt
public static int randomInt() -
randomPositiveInt
public static int randomPositiveInt() -
randomPositiveIntOrNull
-
randomBuffer
-
randomInterval
public static int randomInterval(int min, int max) -
randomMax
public static int randomMax(int max) -
randomPort
public static int randomPort() -
randomShort
public static short randomShort() -
randomByte
public static byte randomByte() -
randomBoolean
public static boolean randomBoolean() -
randomBytes
public static byte[] randomBytes() -
randomBytes
public static byte[] randomBytes(int length) -
randomDouble
public static double randomDouble() -
randomFloat
public static float randomFloat()
-