fold<R> method

R fold<R>({
  1. required R single(),
  2. required R multi(),
  3. required R tree(),
})

Implementation

R fold<R>({
  required R Function() single,
  required R Function() multi,
  required R Function() tree,
}) {
  switch (this) {
    case BuildFormat.single:
      return single();
    case BuildFormat.multi:
      return multi();
    case BuildFormat.tree:
      return tree();
  }
}