Pip-Services-Commons-Dotnet
Static Public Member Functions | List of all members
PipServices3.Commons.Reflect.TypeMatcher Class Reference

Helper class matches value types for equality. This class has symmetric implementation across all languages supported by Pip.Services toolkit and used to support dynamic data processing. More...

Static Public Member Functions

static bool MatchValue (object expectedType, object actualValue)
 Matches expected type to a type of a value. The expected type can be specified by a type, type name or TypeCode. More...
 
static bool MatchValueByName (string expectedType, object actualValue)
 Matches expected type to a type of a value. More...
 
static bool MatchType (object expectedType, Type actualType, object actualValue=null)
 Matches expected type to an actual type. The types can be specified as types, type names or TypeCode. More...
 
static bool MatchTypeByName (string expectedType, Type actualType)
 Matches expected type to an actual type. More...
 
static bool MatchEnum (object expectedType, object value)
 

Detailed Description

Helper class matches value types for equality. This class has symmetric implementation across all languages supported by Pip.Services toolkit and used to support dynamic data processing.

See Convert.TypeCode

Member Function Documentation

◆ MatchType()

static bool PipServices3.Commons.Reflect.TypeMatcher.MatchType ( object  expectedType,
Type  actualType,
object  actualValue = null 
)
static

Matches expected type to an actual type. The types can be specified as types, type names or TypeCode.

Parameters
expectedTypean expected type to match.
actualTypean actual type to match.
Returns
true if types are matching and false if they don't.

See MatchTypeByName(string, Type)

◆ MatchTypeByName()

static bool PipServices3.Commons.Reflect.TypeMatcher.MatchTypeByName ( string  expectedType,
Type  actualType 
)
static

Matches expected type to an actual type.

Parameters
expectedTypean expected type name to match.
actualTypean actual type to match defined by type code.
Returns
true if types are matching and false if they don't.

◆ MatchValue()

static bool PipServices3.Commons.Reflect.TypeMatcher.MatchValue ( object  expectedType,
object  actualValue 
)
static

Matches expected type to a type of a value. The expected type can be specified by a type, type name or TypeCode.

Parameters
expectedTypean expected type to match.
actualValuea value to match its type to the expected one.
Returns
true if types are matching and false if they don't.

See MatchType(object, Type)

◆ MatchValueByName()

static bool PipServices3.Commons.Reflect.TypeMatcher.MatchValueByName ( string  expectedType,
object  actualValue 
)
static

Matches expected type to a type of a value.

Parameters
expectedTypean expected type to match.
actualValuea value to match its type to the expected one.
Returns
true if types are matching and false if they don't.

The documentation for this class was generated from the following file: