Interface Randomizer
-
- All Known Implementing Classes:
RandomizerImpl
public interface RandomizerGenerates random values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringrandomAlphanumericString(int length)Generates and returns a random alphanumeric string of the specified length.StringrandomUrlSafeString(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
-
-