public class Base64UrlEncodedRandomStringGenerator extends java.lang.Object implements StringGenerator
Constructor and Description |
---|
Base64UrlEncodedRandomStringGenerator(ByteSequenceGenerator byteSequenceGenerator)
Creates a new instance that creates new strings based on the given
ByteSequenceGenerator . |
Base64UrlEncodedRandomStringGenerator(int byteSequenceLength)
Creates a new instance that creates new strings based on a
ByteSequenceGenerator
with the given length for the by sequences. |
Modifier and Type | Method and Description |
---|---|
static Base64UrlEncodedRandomStringGenerator |
create(ByteSequenceGenerator byteSequenceGenerator)
Creates a new instance that creates new strings based on the given
ByteSequenceGenerator . |
static Base64UrlEncodedRandomStringGenerator |
create(int byteSequenceLength)
Creates a new instance that creates new strings based on a
ByteSequenceGenerator
with the given length for the by sequences. |
java.lang.String |
generateString()
Generates a new string.
|
java.lang.String |
generateString(int length)
Generates a new string with the specified length.
|
protected IBase64Encoder |
getBase64Encoder() |
protected ByteSequenceGenerator |
getByteSequenceGenerator() |
java.lang.String |
toString() |
public Base64UrlEncodedRandomStringGenerator(int byteSequenceLength)
ByteSequenceGenerator
with the given length for the by sequences.byteSequenceLength
- The length of the random byte sequences to be used.public Base64UrlEncodedRandomStringGenerator(ByteSequenceGenerator byteSequenceGenerator)
ByteSequenceGenerator
.byteSequenceGenerator
- The generator for new byte sequences.public static Base64UrlEncodedRandomStringGenerator create(int byteSequenceLength)
ByteSequenceGenerator
with the given length for the by sequences.byteSequenceLength
- The length of the random byte sequences to be used.public static Base64UrlEncodedRandomStringGenerator create(ByteSequenceGenerator byteSequenceGenerator)
ByteSequenceGenerator
.byteSequenceGenerator
- The generator for new byte sequences.public java.lang.String generateString()
StringGenerator
generateString
in interface StringGenerator
public java.lang.String generateString(int length)
StringGenerator
generateString
in interface StringGenerator
length
- The length of the string to generate.public java.lang.String toString()
toString
in class java.lang.Object
protected IBase64Encoder getBase64Encoder()
protected ByteSequenceGenerator getByteSequenceGenerator()