Table of Contents

Class AbstractGenericConverter

Namespace
Steeltoe.Common.Converter
Assembly
Steeltoe.Common.dll
public abstract class AbstractGenericConverter : IGenericConverter
Inheritance
AbstractGenericConverter
Implements
Derived
Inherited Members

Constructors

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

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

Parameters

convertableTypes ISet<(Type Source, Type Target)>

Properties

ConvertibleTypes

Gets the source and target types this converter can convert between.

public ISet<(Type Source, Type Target)> ConvertibleTypes { get; }

Property Value

ISet<(Type Source, Type Target)>

Methods

Convert(object, Type, Type)

Convert the source object to the target type.

public abstract 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