Interface IValueExtractor
Implements the interface to extract the meaningful attributes from given objects, Similar to Mapper in MapReduce framework.
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public interface IValueExtractor
Extract(Object)
Contains the logic to extract meaningful information/attributes fromm the given object.
Declaration
object Extract(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Value / Object |
Returns
Type | Description |
---|---|
System.Object | Returns the extracted value, which can also be null. |
Examples
Following example demonstrates the implementation of Extract.
public object Extract(object value)
{
try
{
if (value.GetType() == typeof(int))
{
return 0;
}
if (value.GetType() == typeof(float))
{
return 0.0;
}
}
catch (Exception e)
{
//handle exception
}
return value;
}