Interface Randomizer
- All Known Implementing Classes:
RandomizerImpl
public interface Randomizer
Generates random values.
-
Method Summary
Modifier and TypeMethodDescriptionrandomAlphanumericString
(int length) Generates and returns a random alphanumeric string of the specified length.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 Details
-
randomAlphanumericString
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
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
-