@InterfaceAudience.Private public class ReflectionUtils extends Object
Constructor and Description |
---|
ReflectionUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> Constructor<T> |
findConstructor(Class<T> type,
Object... paramTypes) |
static <T> T |
instantiateWithCustomCtor(String className,
Class<?>[] ctorArgTypes,
Object[] ctorArgs) |
static Object |
invokeMethod(Object obj,
String methodName,
Object... params)
Get and invoke the target method from the given object with given parameters
|
static void |
logThreadInfo(org.slf4j.Logger log,
String title,
long minInterval)
Log the current thread stacks at INFO level.
|
static <T> T |
newInstance(Class<T> type,
Object... params) |
public static <T> T instantiateWithCustomCtor(String className, Class<?>[] ctorArgTypes, Object[] ctorArgs)
public static <T> Constructor<T> findConstructor(Class<T> type, Object... paramTypes)
public static void logThreadInfo(org.slf4j.Logger log, String title, long minInterval)
log
- the logger that logs the stack tracetitle
- a descriptive title for the call stacksminInterval
- the minimum time from the last@NonNull public static Object invokeMethod(Object obj, String methodName, Object... params)
obj
- the object to get and invoke method frommethodName
- the name of the method to invokeparams
- the parameters for the method to invokeCopyright © 2007–2019 Cloudera. All rights reserved.