Class RandomStringFactory

java.lang.Object
io.github.astrapi69.random.object.RandomStringFactory

public final class RandomStringFactory extends Object
A factory for creating random String objects
  • Method Details

    • newRandomString

      public static String newRandomString()
      Generates a random string with a length between 3 and 25
      Returns:
      The produced random String.
    • newRandomString

      public static String newRandomString(int length)
      Generates a random string.
      Parameters:
      length - the specified length.
      Returns:
      the generated random string.
    • newRandomLongString

      public static String newRandomLongString(long length)
      Generates a random string.
      Parameters:
      length - the specified length.
      Returns:
      the generated random string.
    • newRandomString

      public static String newRandomString(int start, int end)
      Generates a random string with a length between the given start and end
      Parameters:
      start - the start
      end - the end
      Returns:
      the generated random string
    • newRandomString

      public static String newRandomString(String chars, int length)
      The Method randomString(String, int) makes an random String from the given String and to the specified length. This can be used to produce passwords.
      Parameters:
      chars - The String to get the random chars.
      length - The length from the random String.
      Returns:
      The produced random String.
    • newRandomLongString

      public static String newRandomLongString(String chars, long length)
      The Method randomString(String, long) makes an random String from the given String and to the specified length. This can be used to produce passwords.
      Parameters:
      chars - The String to get the random chars.
      length - The length from the random String.
      Returns:
      The produced random String.
    • newRandomString

      public static String newRandomString(String[] array)
      The Method randomString(String []) a random String from the Array For example: The Stringarray test as argument. Possible values: "blab", "flih", "klap", "teta", "brut", "gzft", "ccp". Possible selection can be one value from the Stringarray like "blab" or "klap".
      Parameters:
      array - The array with the String to be selected.
      Returns:
      The selected String from the array.
    • randomHexString

      public static String randomHexString(int numberOfCharacters)
      Generates a random hexadecimal String
      Parameters:
      numberOfCharacters - the number of characters
      Returns:
      the generated random hexadecimal String