Interface ShuffleSpec<T>

Type Parameters:
T - the type of elements
All Superinterfaces:
GeneratorSpec<Collection<T>>, Supplier<Collection<T>>, ValueSpec<Collection<T>>

@ExperimentalApi public interface ShuffleSpec<T> extends ValueSpec<Collection<T>>
Spec for shuffling elements in a random order, providing the results as a Collection.
Since:
5.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    shuffle(Collection<T> collection)
    Creates a copy of the specified collection and shuffles its elements.
    shuffle(T... array)
    Creates a copy of the specified array and shuffles its elements.

    Methods inherited from interface org.instancio.generator.ValueSpec

    get, list, map, nullable, stream
  • Method Details

    • shuffle

      @ExperimentalApi ShuffleSpec<T> shuffle(T... array)
      Creates a copy of the specified array and shuffles its elements.
      Parameters:
      array - containing the elements to shuffle
      Returns:
      spec builder
      Since:
      5.0.0
    • shuffle

      @ExperimentalApi ShuffleSpec<T> shuffle(Collection<T> collection)
      Creates a copy of the specified collection and shuffles its elements.
      Parameters:
      collection - containing the elements to shuffle
      Returns:
      spec builder
      Since:
      5.0.0