java.lang.Object
io.github.astrapi69.random.object.RandomStringFactory
A factory for creating random
String
objects-
Method Summary
Modifier and TypeMethodDescriptionstatic String
newRandomLongString
(long length) Generates a random string.static String
newRandomLongString
(String chars, long length) The Method randomString(String, long) makes an random String from the given String and to the specified length.static String
Generates a random string with a length between 3 and 25static String
newRandomString
(int length) Generates a random string.static String
newRandomString
(int start, int end) Generates a random string with a length between the given start and endstatic String
newRandomString
(String[] array) The Method randomString(String []) a random String from the Array For example: The Stringarray test as argument.static String
newRandomString
(String chars, int length) The Method randomString(String, int) makes an random String from the given String and to the specified length.static String
randomHexString
(int numberOfCharacters) Generates a random hexadecimalString
-
Method Details
-
newRandomString
Generates a random string with a length between 3 and 25- Returns:
- The produced random String.
-
newRandomString
Generates a random string.- Parameters:
length
- the specified length.- Returns:
- the generated random string.
-
newRandomLongString
Generates a random string.- Parameters:
length
- the specified length.- Returns:
- the generated random string.
-
newRandomString
Generates a random string with a length between the given start and end- Parameters:
start
- the startend
- the end- Returns:
- the generated random string
-
newRandomString
The Method randomString(String, int) makes an random String from the given String and to the specified length. This can be used to produce passwords.- Parameters:
chars
- The String to get the random chars.length
- The length from the random String.- Returns:
- The produced random String.
-
newRandomLongString
The Method randomString(String, long) makes an random String from the given String and to the specified length. This can be used to produce passwords.- Parameters:
chars
- The String to get the random chars.length
- The length from the random String.- Returns:
- The produced random String.
-
newRandomString
The Method randomString(String []) a random String from the Array For example: The Stringarray test as argument. Possible values: "blab", "flih", "klap", "teta", "brut", "gzft", "ccp". Possible selection can be one value from the Stringarray like "blab" or "klap".- Parameters:
array
- The array with the String to be selected.- Returns:
- The selected String from the array.
-
randomHexString
Generates a random hexadecimalString
- Parameters:
numberOfCharacters
- the number of characters- Returns:
- the generated random hexadecimal
String
-