Table of Contents

Class PurePathMatchExtensions

Namespace
Olve.Paths
Assembly
Olve.Paths.dll

Provides functional matching methods for IPurePath implementations.

public static class PurePathMatchExtensions
Inheritance
PurePathMatchExtensions
Inherited Members

Methods

Match<T, TOut>(IPurePath, Func<T, TOut>, Func<TOut>)

Matches the given IPurePath instance against a single type and returns a result.

public static TOut Match<T, TOut>(this IPurePath path, Func<T, TOut> action, Func<TOut> fallback) where T : IPurePath

Parameters

path IPurePath
action Func<T, TOut>
fallback Func<TOut>

Returns

TOut

Type Parameters

T
TOut

Match<T1, T2, TOut>(IPurePath, Func<T1, TOut>, Func<T2, TOut>, Func<TOut>)

Matches the given IPurePath instance against two possible types and returns a result.

public static TOut Match<T1, T2, TOut>(this IPurePath path, Func<T1, TOut> action1, Func<T2, TOut> action2, Func<TOut> fallback) where T1 : IPurePath where T2 : IPurePath

Parameters

path IPurePath
action1 Func<T1, TOut>
action2 Func<T2, TOut>
fallback Func<TOut>

Returns

TOut

Type Parameters

T1
T2
TOut

Match<T1, T2, T3, TOut>(IPurePath, Func<T1, TOut>, Func<T2, TOut>, Func<T3, TOut>, Func<TOut>)

Matches the given IPurePath instance against three possible types and returns a result.

public static TOut Match<T1, T2, T3, TOut>(this IPurePath path, Func<T1, TOut> action1, Func<T2, TOut> action2, Func<T3, TOut> action3, Func<TOut> fallback) where T1 : IPurePath where T2 : IPurePath where T3 : IPurePath

Parameters

path IPurePath
action1 Func<T1, TOut>
action2 Func<T2, TOut>
action3 Func<T3, TOut>
fallback Func<TOut>

Returns

TOut

Type Parameters

T1
T2
T3
TOut