Table of Contents

Class AbstractToNumberConverter

Namespace
Steeltoe.Common.Converter
Assembly
Steeltoe.Common.dll
public abstract class AbstractToNumberConverter : AbstractGenericConditionalConverter, IConditionalGenericConverter, IConditionalConverter, IGenericConverter
Inheritance
AbstractToNumberConverter
Implements
Derived
Inherited Members

Constructors

AbstractToNumberConverter(ISet<(Type Source, Type Target)>)

protected AbstractToNumberConverter(ISet<(Type Source, Type Target)> convertableTypes)

Parameters

convertableTypes ISet<(Type Source, Type Target)>

Fields

_convertableTypes

protected ISet<(Type Source, Type Target)> _convertableTypes

Field Value

ISet<(Type Source, Type Target)>

Methods

Convert(object, Type, Type)

Convert the source object to the target type.

public override object Convert(object source, Type sourceType, Type targetType)

Parameters

source object

the object to convert; the source can be null

sourceType Type

the type of the source that should be used during the conversion. Can be null, and defaults to the type of the source object

targetType Type

the type we are converting to

Returns

object

the converted object

Matches(Type, Type)

Can the conversion from source type to target type be performed by this converter

public override bool Matches(Type sourceType, Type targetType)

Parameters

sourceType Type

the type of the source object to convert from

targetType Type

the type of the target object to conver to

Returns

bool

true if the conversion can be performed