Class RandomString
java.lang.Object
net.bytebuddy.utility.RandomString
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default length of a randomizedString.private static final intThe amount of bits to extract out of an integer for each key generated.private final intThe length of the random strings that are created by this instance.private final RandomA provider of random values.private static final char[]The symbols which are used to create a randomString. -
Constructor Summary
ConstructorsConstructorDescriptionRandomString(int length) Creates a randomStringprovider where each value is of the given length.RandomString(int length, Random random) Creates a randomStringprovider where each value is of the given length. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringhashOf(int value) Represents an integer value as a string hash.static StringRepresents a object value as a string hash.static Stringmake()Creates a randomStringofDEFAULT_LENGTHlength.static Stringmake(int length) Creates a randomStringof the givenlength.Creates a new randomString.
-
Field Details
-
DEFAULT_LENGTH
-
SYMBOL
private static final char[] SYMBOLThe symbols which are used to create a randomString. -
KEY_BITS
private static final int KEY_BITSThe amount of bits to extract out of an integer for each key generated. -
random
A provider of random values. -
length
private final int lengthThe length of the random strings that are created by this instance.
-
-
Constructor Details
-
RandomString
public RandomString() -
RandomString
-
RandomString
-
-
Method Details
-
make
Creates a randomStringofDEFAULT_LENGTHlength.- Returns:
- A random
String.
-
make
-
hashOf
Represents a object value as a string hash. This string is not technically random but generates a fixed character sequence based on the hash provided.- Parameters:
value- The value to represent as a string ornull.- Returns:
- A string representing the supplied value as a string.
-
hashOf
Represents an integer value as a string hash. This string is not technically random but generates a fixed character sequence based on the hash provided.- Parameters:
value- The value to represent as a string.- Returns:
- A string representing the supplied value as a string.
-
nextString
-