match<T> method

T match<T>({
  1. required T borders(
    1. Borders value
    ),
  2. required T orderedValues(
    1. OrderedValues value
    ),
})

Implementation

T match<T>({
  required T Function(Borders value) borders,
  required T Function(OrderedValues value) orderedValues,
}) {
  return switch (this._index) {
    0 => borders(this._value as Borders),
    1 => orderedValues(this._value as OrderedValues),
    _ => throw NativeException("Unrecognized case index ${this._index}")
  };
}