public interface TextRandomProvider
TextRandomProvider implementations are used by
as a source of randomness. It is highly recommended that the
Apache Commons RNG
library be used to provide the random number generation.
When using Java 8 or later, TextRandomProvider is a functional interface and need not be explicitly implemented. For example:
UniformRandomProvider rng = RandomSource.create(...); RandomStringGenerator gen = new RandomStringGenerator.Builder() .usingRandom(rng::nextInt) // additional builder calls as needed .build();
int nextInt(int max)
max- Bound on the random number to be returned. Must be positive.
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.