Interface OneOfArrayGeneratorSpec<T>

Type Parameters:
T - type of value
All Superinterfaces:
AsGeneratorSpec<T>, GeneratorSpec<T>, NullableGeneratorSpec<T>

public interface OneOfArrayGeneratorSpec<T> extends AsGeneratorSpec<T>, NullableGeneratorSpec<T>
Generator spec for selecting a random value from an array.
Since:
1.0.1
  • Method Details

    • oneOf

      OneOfArrayGeneratorSpec<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:
      1.0.1
    • nullable

      Indicates that null value can be generated.
      Specified by:
      nullable in interface NullableGeneratorSpec<T>
      Returns:
      spec builder
    • orRandom

      Allows the generator to produce either one of the preset values defined via oneOf(Object...) or a random value of the target type.
      Returns:
      spec builder
      Since:
      5.4.0