Interface Randomizer

  • All Known Implementing Classes:
    RandomizerImpl

    public interface Randomizer
    Generates random values.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String randomAlphanumericString​(int length)
      Generates and returns a random alphanumeric string of the specified length.
      String randomUrlSafeString​(int length)
      Generates a URL-safe random string with the given length
      The resulting string will contain ASCII characters [0-9], [A-Z], and [a-z], as well as the URL-safe characters '-' and '_', and can be safely used anywhere in the URL, including as query parameters
    • Method Detail

      • randomAlphanumericString

        String randomAlphanumericString​(int length)
        Generates and returns a random alphanumeric string of the specified length.
        Parameters:
        length - length of the random string (in chars)
        Returns:
        random alphanumeric string of the specified length
      • randomUrlSafeString

        String randomUrlSafeString​(int length)
        Generates a URL-safe random string with the given length
        The resulting string will contain ASCII characters [0-9], [A-Z], and [a-z], as well as the URL-safe characters '-' and '_', and can be safely used anywhere in the URL, including as query parameters
        Parameters:
        length - length of the random string (in chars)
        Returns:
        random URL-safe string of the specified length