RandomStringGenerator
as a source of randomness. It is highly recommended that the
Apache Commons RNG
library be used to provide the random number generation.
TextRandomProvider is a functional interface and need not be explicitly implemented.
For example:
UniformRandomProvider rng = RandomSource.create(...);
RandomStringGenerator gen = RandomStringGenerator.builder()
.usingRandom(rng::nextInt)
// additional builder calls as needed
.build();
| Modifier and Type | Method and Description |
|---|---|
| public default int | Returns: a random int value between 0 (inclusive) and max (exclusive).Bound on the random number to be returned. Must be positive. max)Implements java. Generates an int value between 0 (inclusive) and the specified value (exclusive). |
| public int | Returns: a random int value between 0 (inclusive) and max (exclusive).Bound on the random number to be returned. Must be positive. max)
Deprecated
Use
applyAsInt(int).
Generates an int value between 0 (inclusive) and the specified value (exclusive). |
| applyAsInt | back to summary |
|---|---|
| public default int applyAsInt(final int max) Implements java. Generates an int value between 0 (inclusive) and the specified value (exclusive).
| |
| nextInt | back to summary |
|---|---|
| public int nextInt(int max)
Deprecated Use Generates an int value between 0 (inclusive) and the specified value (exclusive).
| |