match<T> method

T match<T>({
  1. required T defaultSource(
    1. DefaultRasterUrlTemplate value
    ),
  2. required T wmsSource(
    1. WmsRasterUrlTemplate value
    ),
})

Implementation

T match<T>({
  required T Function(DefaultRasterUrlTemplate value) defaultSource,
  required T Function(WmsRasterUrlTemplate value) wmsSource,
}) {
  return switch (this._index) {
    0 => defaultSource(this._value as DefaultRasterUrlTemplate),
    1 => wmsSource(this._value as WmsRasterUrlTemplate),
    _ => throw NativeException("Unrecognized case index ${this._index}")
  };
}