Interface IValueExtractor
Implements the interface to extract meaningful attributes from given objects, similar to Mapper in the MapReduce framework.
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public interface IValueExtractor
              Methods
Extract(Object)
This method takes in an Object and contains the logic to extract meaningful information/attributes from the object like the Mapper does in the MapReduce.
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
The 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;
}