Class RandomizerImpl
java.lang.Object
com.atlassian.bitbucket.jenkins.internal.applink.oauth.RandomizerImpl
- All Implemented Interfaces:
Randomizer
Implementation of
As a result, the strings generated by this class can safely be passed as part of a URL (e.g. via query parameters).
Randomizer
that generates random strings of specified lengths and specific character sets
(e.g. alphanumeric characters
, or
URL-safe characters
).
As a result, the strings generated by this class can safely be passed as part of a URL (e.g. via query parameters).
-
Constructor Summary
-
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
-
Constructor Details
-
RandomizerImpl
public RandomizerImpl()
-
-
Method Details
-
randomAlphanumericString
Description copied from interface:Randomizer
Generates and returns a random alphanumeric string of the specified length.- Specified by:
randomAlphanumericString
in interfaceRandomizer
- Parameters:
length
- length of the random string (in chars)- Returns:
- random alphanumeric string of the specified length
-
randomUrlSafeString
Description copied from interface:Randomizer
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- Specified by:
randomUrlSafeString
in interfaceRandomizer
- Parameters:
length
- length of the random string (in chars)- Returns:
- random URL-safe string of the specified length
-