Interface OneOfArraySpec<T>

Type Parameters:
T - type of value
All Superinterfaces:
GeneratorSpec<T>, Supplier<T>, ValueSpec<T>

public interface OneOfArraySpec<T> extends ValueSpec<T>
Spec for selecting a random value from an array.
Since:
2.6.0
  • Method Summary

    Modifier and Type
    Method
    Description
    oneOf(T... values)
    Selects a random value from the given choices.

    Methods inherited from interface org.instancio.generator.ValueSpec

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

    • oneOf

      ValueSpec<T> oneOf(T... values)
      Selects a random value from the given choices.
      Parameters:
      values - from which a random value will be selected
      Returns:
      spec builder
      Since:
      2.6.0