maybeWhen<T> method

T maybeWhen<T>({
  1. T? content()?,
  2. T? override()?,
  3. T? room()?,
  4. T? sender()?,
  5. T? underride()?,
  6. required T orElse(),
})

Implementation

T maybeWhen<T>({
  T? Function()? content,
  T? Function()? override,
  T? Function()? room,
  T? Function()? sender,
  T? Function()? underride,
  required T Function() orElse,
}) =>
    {
      PushRuleKind.content: content,
      PushRuleKind.override: override,
      PushRuleKind.room: room,
      PushRuleKind.sender: sender,
      PushRuleKind.underride: underride,
    }[this]
        ?.call() ??
    orElse();