Interface Randomizer<T>

Type Parameters:
T - the type of random object produced
All Known Implementing Classes:
PersonRandomizer

public interface Randomizer<T>
`Randomizer` implementations are used to produce random instances of the specified object type on-demand.
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<T>
    many(int count)
    Used to generate a list of `count` randomly generated instances of the target class.
    one()
    Used to generate a single random instance of the target class.
    default Stream<T>
    stream(int count)
    Used to generate a stream of `count` randomly generated instances of the target class.
  • Method Details

    • one

      T one()
      Used to generate a single random instance of the target class.
      Returns:
      a random instance of the target class
    • many

      default List<T> many(int count)
      Used to generate a list of `count` randomly generated instances of the target class.
      Parameters:
      count - the number of items in the list
      Returns:
      an unmodifiable list of randomly generated items
    • stream

      default Stream<T> stream(int count)
      Used to generate a stream of `count` randomly generated instances of the target class.
      Parameters:
      count - the number of items in the stream
      Returns:
      a Stream of randomly generated items