@Public
@Evolving
public class ReflectionUtils
extends java.lang.Object
| Constructor | Description |
|---|---|
ReflectionUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static void |
cloneWritableInto(Writable dst,
Writable src) |
Deprecated.
|
static <T> T |
copy(Configuration conf,
T src,
T dst) |
Make a copy of the writable object using serialization to a buffer.
|
static <T> java.lang.Class<T> |
getClass(T o) |
Return the correctly-typed
Class of the given object. |
static java.util.List<java.lang.reflect.Field> |
getDeclaredFieldsIncludingInherited(java.lang.Class<?> clazz) |
Gets all the declared fields of a class including fields declared in
superclasses.
|
static java.util.List<java.lang.reflect.Method> |
getDeclaredMethodsIncludingInherited(java.lang.Class<?> clazz) |
Gets all the declared methods of a class including methods declared in
superclasses.
|
static void |
logThreadInfo(org.apache.commons.logging.Log log,
java.lang.String title,
long minInterval) |
Deprecated.
to be removed with 3.4.0.
|
static void |
logThreadInfo(org.slf4j.Logger log,
java.lang.String title,
long minInterval) |
Log the current thread stacks at INFO level.
|
static <T> T |
newInstance(java.lang.Class<T> theClass,
Configuration conf) |
Create an object for the given class and initialize it from conf
|
static <T> T |
newInstance(java.lang.Class<T> theClass,
Configuration conf,
java.lang.Class<?>[] argTypes,
java.lang.Object... values) |
Create an object for the given class and initialize it from conf
|
static void |
printThreadInfo(java.io.PrintStream stream,
java.lang.String title) |
Print all of the thread's information and stack traces.
|
static void |
setConf(java.lang.Object theObject,
Configuration conf) |
Check and set 'configuration' if necessary.
|
static void |
setContentionTracing(boolean val) |
public static void setConf(java.lang.Object theObject,
Configuration conf)
theObject - object for which to set configurationconf - Configurationpublic static <T> T newInstance(java.lang.Class<T> theClass,
Configuration conf)
T - Generics Type T.theClass - class of which an object is createdconf - Configurationpublic static <T> T newInstance(java.lang.Class<T> theClass,
Configuration conf,
java.lang.Class<?>[] argTypes,
java.lang.Object... values)
T - Generics Type.theClass - class of which an object is createdconf - ConfigurationargTypes - the types of the argumentsvalues - the values of the argumentspublic static void setContentionTracing(boolean val)
public static void printThreadInfo(java.io.PrintStream stream,
java.lang.String title)
stream - the stream totitle - a string title for the stack trace@Deprecated
public static void logThreadInfo(org.apache.commons.logging.Log log,
java.lang.String title,
long minInterval)
logThreadInfo(Logger, String, long) instead.log - the logger that logs the stack tracetitle - a descriptive title for the call stacksminInterval - the minimum time from the lastpublic static void logThreadInfo(org.slf4j.Logger log,
java.lang.String title,
long minInterval)
log - the logger that logs the stack tracetitle - a descriptive title for the call stacksminInterval - the minimum time from the lastpublic static <T> java.lang.Class<T> getClass(T o)
Class of the given object.T - Generics Type T.o - object whose correctly-typed Class is to be obtainedClass of the given object.public static <T> T copy(Configuration conf, T src, T dst) throws java.io.IOException
T - Generics Type.src - the object to copy fromdst - the object to copy into, which is destroyedconf - configuration.java.io.IOException - raised on errors performing I/O.@Deprecated public static void cloneWritableInto(Writable dst, Writable src) throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<java.lang.reflect.Field> getDeclaredFieldsIncludingInherited(java.lang.Class<?> clazz)
clazz - clazzpublic static java.util.List<java.lang.reflect.Method> getDeclaredMethodsIncludingInherited(java.lang.Class<?> clazz)
clazz - clazz.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.