TypeUtility
Provides some utility methods for types whose exact state may be unknown at compiletime.
Methods
CanDuplicate
#Test whether a duplication mechanism is available for the given object.
Parameters:
| value (object) | Value to test. |
| filter (DuplicationMethods) | Mechanism filter. |
Returns: True if there's a known duplication mechanism.
CanDuplicate
#Test whether a duplication mechanism is available for the given object.
Parameters:
| value (object) | Value to test. |
Returns: True if there's a known duplication mechanism.
CanDuplicate<T>
#Test whether a duplication mechanism is available for the given type.
Returns: True if there's a known duplication mechanism.
CanDuplicate<T>
#Test whether a duplication mechanism is available for the given type.
Parameters:
| filter (DuplicationMethods) | Mechanism filter. |
Returns: True if there's a known duplication mechanism.
DetermineFlavour
#Figure out the TypeFlavour of a specific type. Note that this overload is unable to determine whether the value is a nullable struct. If a nullable struct is supplied and it's null, TypeFlavour.None is returned. If the type is not null, TypeFlavour.Struct is returned. We recommend using the DetermineFlavour<T<() overload.
Parameters:
| value (object) | Value of type to examine. |
Returns: TypeFlavour associates with T.
DetermineFlavour
#Figure out the TypeFlavour of a specific type.
Parameters:
| type (Type) | Type to examine. |
Returns: TypeFlavour associated with T.
GetDuplicationDelegate<T>
#Try and get a duplication delegate that fits the relevant type. Duplication delegates can be constructed for structs, nullable structs, types with registered TypeAssistants, and types that implement ICloneable, ISerializable and/or IStorable, in that order.
Returns: Predefined duplication delegate if any.
GetDuplicationDelegate<T>
#Try and get a duplication delegate that fits the relevant type. Duplication delegates can be constructed for structs, nullable structs, types with registered TypeAssistants, and types that implement ICloneable, ISerializable and/or IStorable, in that order.
Parameters:
| filter (DuplicationMethods) | Type filter. |
Returns: Predefined duplication delegate if any.
TryDuplicateObject
#Try and duplicate an object. Duplication is defined for structs, nullable structs, types with registered TypeAssistants, and types that implement ICloneable, ISerializable and/or IStorable, in that order.
Parameters:
| value (object) | Value to duplicate. |
| filter (DuplicationMethods) | Duplication methods to test. |
Returns: Duplicated object or null.
TryDuplicateObject
#Try and duplicate an object. Duplication is defined for structs, nullable structs, types with registered TypeAssistants, and types that implement ICloneable, ISerializable and/or IStorable, in that order.
Parameters:
| value (object) | Value to duplicate. |
Returns: Duplicated object or null.