Class RandomUtil

java.lang.Object
org.apache.activemq.artemis.utils.RandomUtil

public class RandomUtil extends Object
  • Field Details

    • random

      protected static final Random random
  • Constructor Details

    • RandomUtil

      public RandomUtil()
  • Method Details

    • getRandom

      public static Random getRandom()
    • randomAlphaNumericString

      public static String randomAlphaNumericString(int length)
      Utility method to build a String filled with random alpha-numeric characters. The String will contain characters from the following:
      • abcdefghijklmnopqrstuvwxyz
      • ABCDEFGHIJKLMNOPQRSTUVWXYZ
      • 0123456789
      Parameters:
      length - how long the returned String should be
      Returns:
      a String of random alpha-numeric characters
    • randomUUIDString

      public static String randomUUIDString()
      Returns A randomly generated UUID converted to a String.
      Returns:
      A randomly generated UUID converted to a String
    • randomUUIDSimpleString

      public static SimpleString randomUUIDSimpleString()
      Returns A randomly generated UUID converted to a SimpleString.
      Returns:
      A randomly generated UUID converted to a SimpleString
    • randomChar

      public static char randomChar()
      Utility method to get a random alpha-numeric character. The char will 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

      public static Integer randomPositiveIntOrNull()
    • randomBuffer

      public static ActiveMQBuffer randomBuffer(int size, long... data)
    • 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()