either<T> method

Generator<T> either<T>(
  1. Generator<T> first,
  2. Generator<T> second, [
  3. Generator<T>? third,
  4. Generator<T>? fourth,
  5. Generator<T>? fifth,
  6. Generator<T>? sixth,
  7. Generator<T>? seventh,
  8. Generator<T>? nineth,
  9. Generator<T>? tenth,
])

Uses either one of the provided generators to generate a value.

See oneOf for a version of this method to be used if the number of generators is not known at compile-time.

Implementation

Generator<T> either<T>(
  Generator<T> first,
  Generator<T> second, [
  Generator<T>? third,
  Generator<T>? fourth,
  Generator<T>? fifth,
  Generator<T>? sixth,
  Generator<T>? seventh,
  Generator<T>? nineth,
  Generator<T>? tenth,
]) {
  return oneOf([
    first,
    second,
    if (third != null) third,
    if (fourth != null) fourth,
    if (fifth != null) fifth,
    if (sixth != null) sixth,
    if (seventh != null) seventh,
    if (nineth != null) nineth,
    if (tenth != null) tenth,
  ]);
}