public class RandomString
extends java.lang.Object
String
values.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LENGTH
The default length of a randomized
String . |
private static int |
KEY_BITS
The amount of bits to extract out of an integer for each key generated.
|
private int |
length
The length of the random strings that are created by this instance.
|
private java.util.Random |
random
A provider of random values.
|
private static char[] |
SYMBOL
The symbols which are used to create a random
String . |
Constructor and Description |
---|
RandomString()
|
RandomString(int length)
Creates a random
String provider where each value is of the given length. |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
hashOf(int value)
Represents an integer value as a string hash.
|
static java.lang.String |
make()
Creates a random
String of DEFAULT_LENGTH length. |
static java.lang.String |
make(int length)
Creates a random
String of the given length . |
java.lang.String |
nextString()
Creates a new random
String . |
public static final int DEFAULT_LENGTH
String
.private static final char[] SYMBOL
String
.private static final int KEY_BITS
private final java.util.Random random
private final int length
public RandomString()
public RandomString(int length)
String
provider where each value is of the given length.length
- The length of the random String
.public static java.lang.String make()
String
of DEFAULT_LENGTH
length.String
.public static java.lang.String make(int length)
String
of the given length
.length
- The length of the random String
.String
.public static java.lang.String hashOf(int value)
value
- The value to represent as a string.public java.lang.String nextString()
String
.String
of the given length for this instance.