p2pMapReduce.mapreduceModule.util
Class ReflectionUtils

java.lang.Object
  extended by p2pMapReduce.mapreduceModule.util.ReflectionUtils

public class ReflectionUtils
extends java.lang.Object

General reflection utils


Constructor Summary
ReflectionUtils()
           
 
Method Summary
static
<T> java.lang.Class<T>
getClass(T o)
          Return the correctly-typed Class of the given object.
static
<T> T
newInstance(java.lang.Class<T> theClass, Configuration conf)
          Create an object for the given class and initialize it from conf
static void setConf(java.lang.Object theObject, Configuration conf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionUtils

public ReflectionUtils()
Method Detail

newInstance

public static <T> T newInstance(java.lang.Class<T> theClass,
                                Configuration conf)
Create an object for the given class and initialize it from conf

Parameters:
theClass - class of which an object is created
conf - Configuration
Returns:
a new object

getClass

public static <T> java.lang.Class<T> getClass(T o)
Return the correctly-typed Class of the given object.

Parameters:
o - object whose correctly-typed Class is to be obtained
Returns:
the correctly typed Class of the given object.

setConf

public static void setConf(java.lang.Object theObject,
                           Configuration conf)