Class RandomStringUtil

java.lang.Object
de.fraunhofer.iese.mydata.util.RandomStringUtil

public class RandomStringUtil extends Object
Generate a random string
  • Field Details

    • UPPER

      public static final String UPPER
      Upper case letters
      See Also:
    • LOWER

      public static final String LOWER
      Lower case letters
    • DIGITS

      public static final String DIGITS
      Digits
      See Also:
    • SPECIAL

      public static final String SPECIAL
      Special characters that you can also use in URL parameters without coding
      See Also:
    • ALPHANUM

      public static final String ALPHANUM
      Alphanumeric characters
    • ALPHANUMSPECIAL

      public static final String ALPHANUMSPECIAL
      Alphanumeric characters and special chars
  • Constructor Details

    • RandomStringUtil

      public RandomStringUtil(int length, Random random, String symbols)
      Parameters:
      length - Length of the random string to be generated
      random - Random instance to be used to generate the random string
      symbols - Symbols to be used to generate the random string
    • RandomStringUtil

      public RandomStringUtil(int length, String symbols)
      Parameters:
      length - Length of the random string to be generated
      symbols - Symbols to be used to generate the random string
    • RandomStringUtil

      public RandomStringUtil(int length, Random random)
      Create an alphanumeric string generator.
      Parameters:
      length - Length of the random string to be generated
      random - Random instance to be used to generate the random string
    • RandomStringUtil

      public RandomStringUtil(int length)
      Create an alphanumeric strings from a secure generator.
      Parameters:
      length - Length of the random string to be generated
    • RandomStringUtil

      public RandomStringUtil()
      Create session identifiers.
  • Method Details

    • generateString

      public String generateString()
      Generate a random string.
      Returns:
      a random string