Package overit.geocall.util
Class RandomToken
java.lang.Object
overit.geocall.util.RandomToken
The RandomToken object is a string of a given length, which is composed, in the creation phase of the object,
by choosing random characters extracted from the desired alphabet. The class provides a series of pre-established alphabets:
ALPHA_DIGIT, ALPHA, LOWERCASE_DIGIT, UPPERCASE_DIGIT, LOWERCASE,
UPPERCASE, HEX-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringstatic final StringAlphabet composed by uppercase characters and lowercase characters of the English alphabetstatic final StringAlphabet composed by uppercase characters and lowercase characters of the English alphabet and the digits from 0 to 9static final StringAlphabet composed by digits from 0 to 9static final StringAlphabet composed by the characters that defines the hexadecimal notation, with uppercase characters from A to F and digits from 0 to 9static final StringAlphabet composed by lowercase characters of the English alphabetstatic final StringAlphabet composed by lowercase characters of the English alphabet and the digits from 0 to 9static final StringAlphabet composed by uppercase characters of the English alphabetstatic final StringAlphabet composed by uppercase characters of the English alphabet and the digits from 0 to 9 -
Constructor Summary
ConstructorsConstructorDescriptionRandomToken(String alphabet, int size) Generate a random sequence of fixed size string. -
Method Summary
-
Field Details
-
ALPHA_DIGIT
Alphabet composed by uppercase characters and lowercase characters of the English alphabet and the digits from 0 to 9- See Also:
-
ALPHA
Alphabet composed by uppercase characters and lowercase characters of the English alphabet- See Also:
-
LOWERCASE_DIGIT
Alphabet composed by lowercase characters of the English alphabet and the digits from 0 to 9- See Also:
-
UPPERCASE_DIGIT
Alphabet composed by uppercase characters of the English alphabet and the digits from 0 to 9- See Also:
-
LOWERCASE
Alphabet composed by lowercase characters of the English alphabet- See Also:
-
UPPERCASE
Alphabet composed by uppercase characters of the English alphabet- See Also:
-
HEX
Alphabet composed by the characters that defines the hexadecimal notation, with uppercase characters from A to F and digits from 0 to 9- See Also:
-
DIGIT
Alphabet composed by digits from 0 to 9- See Also:
-
_token
-
_code
-
-
Constructor Details
-
RandomToken
Generate a random sequence of fixed size string. The token will be generated using only the characters contained in the given alphabet.- Parameters:
alphabet- string containing the characters that will be used to compose the random string. Generally you can pass one of the following constants:ALPHA_DIGIT: uppercase/lowercase letters and digitsALPHA: uppercase/lowercase lettersLOWERCASE_DIGIT: lowercase letters and digitsUPPERCASE_DIGIT: uppercase letters and digitsLOWERCASE: lowercase lettersUPPERCASE: uppercase lettersHEX: hexadecimal letters and digitsDIGIT: only digits
size- the length of the random string
-
-
Method Details