Package net.bytebuddy.utility
Class RandomString
java.lang.Object
net.bytebuddy.utility.RandomString
A provider of randomized
String values.-
Field Summary
Fields -
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
public static final int DEFAULT_LENGTHThe default length of a randomizedString.- See Also:
-
-
Constructor Details
-
RandomString
public RandomString() -
RandomString
public RandomString(int length) Creates a randomStringprovider where each value is of the given length.- Parameters:
length- The length of the randomString.
-
RandomString
Creates a randomStringprovider where each value is of the given length.- Parameters:
length- The length of the randomString.random- The random number generator to use.
-
-
Method Details
-
make
Creates a randomStringofDEFAULT_LENGTHlength.- Returns:
- A random
String.
-
make
Creates a randomStringof the givenlength. -
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
Creates a new randomString.- Returns:
- A random
Stringof the given length for this instance.
-