Package org.apereo.cas.util.gen
Class DefaultRandomStringGenerator
- java.lang.Object
-
- org.apereo.cas.util.gen.AbstractRandomStringGenerator
-
- org.apereo.cas.util.gen.DefaultRandomStringGenerator
-
- All Implemented Interfaces:
RandomStringGenerator
- Direct Known Subclasses:
DefaultRandomNumberGenerator
public class DefaultRandomStringGenerator extends AbstractRandomStringGenerator
Implementation of the RandomStringGenerator that allows you to define the length of the random part.- Since:
- 3.0.0
-
-
Field Summary
-
Fields inherited from class org.apereo.cas.util.gen.AbstractRandomStringGenerator
defaultLength, randomizer
-
Fields inherited from interface org.apereo.cas.util.gen.RandomStringGenerator
DEFAULT_LENGTH
-
-
Constructor Summary
Constructors Constructor Description DefaultRandomStringGenerator(long defaultLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringconvertBytesToString(byte[] random)Convert bytes to string, taking into accountPRINTABLE_CHARACTERS.protected char[]getPrintableCharacters()Get printable characters char [].-
Methods inherited from class org.apereo.cas.util.gen.AbstractRandomStringGenerator
getAlgorithm, getNewString, getNewString, getNewStringAsBytes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apereo.cas.util.gen.RandomStringGenerator
getDefaultLength
-
-
-
-
Method Detail
-
convertBytesToString
protected java.lang.String convertBytesToString(byte[] random)
Convert bytes to string, taking into accountPRINTABLE_CHARACTERS.- Overrides:
convertBytesToStringin classAbstractRandomStringGenerator- Parameters:
random- the random- Returns:
- the string
-
getPrintableCharacters
protected char[] getPrintableCharacters()
Get printable characters char [].- Returns:
- the char []
-
-