TextRandomProvider (Apache Commons Text 1.11.0 API)
Description: declaration: package: org.apache.commons.text, interface: TextRandomProvider

Package org.apache.commons.text

# Interface TextRandomProvider

public interface TextRandomProvider
TextRandomProvider implementations are used by `RandomStringGenerator` 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 = RandomStringGenerator.builder()
         .usingRandom(rng::nextInt)
         // additional builder calls as needed
         .build();

Since:
  1.1

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `nextInt(int max)`
  Generates an int value between 0 (inclusive) and the specified value (exclusive).

- ## Method Details

  - ### nextInt

    int nextInt(int max)
    Generates an int value between 0 (inclusive) and the specified value (exclusive).
    Parameters:
      `max` - Bound on the random number to be returned. Must be positive.
    Returns:
      a random int value between 0 (inclusive) and n (exclusive).