java.lang.Object
com.github.ushiosan23.jvm.system.Rand
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]Data range for all valid symbolsstatic final int[]Data range for alphanumeric lettersstatic final int[]Data range for all lettersstatic final int[]Data range for all numbers -
Method Summary
Modifier and TypeMethodDescriptionGenerate a random string with an adjustable size.getRandomString(int size) Generate a random string with an adjustable size.getRandomString(int size, int @NotNull [] charLimits) Generate a random string with an adjustable size.static RandomReturn a default system random object.static RandomgetSystemRandom(long seed) Return a default system random object
-
Field Details
-
RAND_LETTERS
public static final int[] RAND_LETTERSData range for all letters -
RAND_NUMBERS
public static final int[] RAND_NUMBERSData range for all numbers -
RAND_ALPHANUMERIC
public static final int[] RAND_ALPHANUMERICData range for alphanumeric letters -
RAND_ALL_SYMBOLS
public static final int[] RAND_ALL_SYMBOLSData range for all valid symbols
-
-
Method Details
-
getSystemRandom
Return a default system random object- Parameters:
seed- Seed for the "Random" item. It is recommended to use the default seed and only apply it for test use.- Returns:
- Returns a default system random
- See Also:
-
getSystemRandom
Return a default system random object. This method applies the seed due to time. It is recommended for use in production.- Returns:
- Returns a default system random
-
getRandomString
Generate a random string with an adjustable size.- Parameters:
size- String sizecharLimits- Limit in which the characters will be generated.- Returns:
- Returns a random string
- See Also:
-
getRandomString
Generate a random string with an adjustable size. By default, this method useRAND_ALL_SYMBOLSlimits- Parameters:
size- String size- Returns:
- Returns a random string
- See Also:
-
getRandomString
Generate a random string with an adjustable size. By default, this method useRAND_ALL_SYMBOLSlimits and size is 18- Returns:
- Returns a random string
- See Also:
-