Interface IConversionService
A service interface for type conversions.
Namespace: Steeltoe.Common.Converter
Assembly: Steeltoe.Common.Abstractions.dll
Syntax
public interface IConversionService
Methods
| Edit this page View SourceCanBypassConvert(Type, Type)
Determine whether the conversion between source type and destination type can be bypassed.
Declaration
bool CanBypassConvert(Type sourceType, Type targetType)
Parameters
Type | Name | Description |
---|---|---|
Type | sourceType | the source type |
Type | targetType | the target type |
Returns
Type | Description |
---|---|
System.Boolean | returns true if it can be bypassed |
CanConvert(Type, Type)
Returns true if objects of the source type can be converted to the target type.
Declaration
bool CanConvert(Type sourceType, Type targetType)
Parameters
Type | Name | Description |
---|---|---|
Type | sourceType | the type of the source object |
Type | targetType | the type of the target object |
Returns
Type | Description |
---|---|
System.Boolean | returns true if the conversion can be performed |
Convert(Object, Type, Type)
Convert the given source to the specified target type.
Declaration
object Convert(object source, Type sourceType, Type targetType)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | the object to convert; may be null |
Type | sourceType | the source objects type |
Type | targetType | the target type to convert to |
Returns
Type | Description |
---|---|
System.Object | the converted object |
Convert<T>(Object)
Convert the given source to the target
Declaration
T Convert<T>(object source)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | the source object to convert |
Returns
Type | Description |
---|---|
T | the converted object |
Type Parameters
Name | Description |
---|---|
T | the target type to convert to |