Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TypeMatcher

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

TypeCode

Hierarchy

  • TypeMatcher

Index

Methods

Static matchType

  • matchType(expectedType: any, actualType: TypeCode, actualValue?: any): boolean
  • Matches expected type to an actual type. The types can be specified as types, type names or TypeCode.

    see

    matchTypeByName

    see

    matchTypeByName (for matching by types' string names)

    Parameters

    • expectedType: any

      an expected type to match.

    • actualType: TypeCode

      an actual type to match.

    • Default value actualValue: any = null

      an optional value to match its type to the expected one.

    Returns boolean

    true if types are matching and false if they don't.

Static matchTypeByName

  • matchTypeByName(expectedType: string, actualType: TypeCode, actualValue?: any): boolean
  • Matches expected type to an actual type.

    Parameters

    • expectedType: string

      an expected type name to match.

    • actualType: TypeCode

      an actual type to match defined by type code.

    • Default value actualValue: any = null

      an optional value to match its type to the expected one.

    Returns boolean

    true if types are matching and false if they don't.

Static matchValueType

  • matchValueType(expectedType: any, actualValue: any): boolean
  • Matches expected type to a type of a value. The expected type can be specified by a type, type name or TypeCode.

    see

    matchType

    see

    matchValueTypeByName (for matching by types' string names)

    Parameters

    • expectedType: any

      an expected type to match.

    • actualValue: any

      a value to match its type to the expected one.

    Returns boolean

    true if types are matching and false if they don't.

Static matchValueTypeByName

  • matchValueTypeByName(expectedType: string, actualValue: any): boolean
  • Matches expected type to a type of a value.

    Parameters

    • expectedType: string

      an expected type name to match.

    • actualValue: any

      a value to match its type to the expected one.

    Returns boolean

    true if types are matching and false if they don't.

Generated using TypeDoc