HostMatcherPatterns extension

Adds pattern-matching-related methods to HostMatcher.

on

Methods

map<TResult extends Object?>({required TResult exact(HostMatcher_Exact value), required TResult suffix(HostMatcher_Suffix value), required TResult cidr(HostMatcher_Cidr value)}) → TResult

Available on HostMatcher, provided by the HostMatcherPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? exact(HostMatcher_Exact value)?, TResult? suffix(HostMatcher_Suffix value)?, TResult? cidr(HostMatcher_Cidr value)?}) → TResult?

Available on HostMatcher, provided by the HostMatcherPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult exact(HostMatcher_Exact value)?, TResult suffix(HostMatcher_Suffix value)?, TResult cidr(HostMatcher_Cidr value)?, required TResult orElse()}) → TResult

Available on HostMatcher, provided by the HostMatcherPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult exact(String value)?, TResult suffix(String value)?, TResult cidr(String value)?, required TResult orElse()}) → TResult

Available on HostMatcher, provided by the HostMatcherPatterns extension

A variant of when that fallback to an orElse callback.
when<TResult extends Object?>({required TResult exact(String value), required TResult suffix(String value), required TResult cidr(String value)}) → TResult

Available on HostMatcher, provided by the HostMatcherPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? exact(String value)?, TResult? suffix(String value)?, TResult? cidr(String value)?}) → TResult?

Available on HostMatcher, provided by the HostMatcherPatterns extension

A variant of when that fallback to returning null