when method

void when({
  1. required void onWait(
    1. MasstransitWait value
    ),
  2. required void onFitness(
    1. MasstransitFitness value
    ),
  3. required void onTransfer(
    1. MasstransitTransfer value
    ),
  4. required void onTaxi(
    1. MasstransitTaxi value
    ),
  5. required void onVectorMasstransitTransport(
    1. List<MasstransitTransport> value
    ),
})

Applies the passed function to the variant value.

Implementation

void when({
  required void Function(MasstransitWait value) onWait,
  required void Function(MasstransitFitness value) onFitness,
  required void Function(MasstransitTransfer value) onTransfer,
  required void Function(MasstransitTaxi value) onTaxi,
  required void Function(
          core.List<transport_masstransit_transport.MasstransitTransport>
              value)
      onVectorMasstransitTransport,
}) {
  if (_value is MasstransitWait) {
    return onWait(_value as MasstransitWait);
  }
  if (_value is MasstransitFitness) {
    return onFitness(_value as MasstransitFitness);
  }
  if (_value is MasstransitTransfer) {
    return onTransfer(_value as MasstransitTransfer);
  }
  if (_value is MasstransitTaxi) {
    return onTaxi(_value as MasstransitTaxi);
  }
  if (_value
      is core.List<transport_masstransit_transport.MasstransitTransport>) {
    return onVectorMasstransitTransport(_value
        as core.List<transport_masstransit_transport.MasstransitTransport>);
  }
  assert(false);
}