public final class ProxyUtils extends Object
Modifier and Type | Field and Description |
---|---|
static Class<?>[] |
EMPTY_ARGUMENT_TYPES |
static Object[] |
EMPTY_ARGUMENTS |
Modifier and Type | Method and Description |
---|---|
static Class<?>[] |
getAllInterfaces(Class<?> cls)
Gets an array of
Class objects representing all interfaces implemented by the given class and its
superclasses. |
static String |
getJavaClassName(Class<?> clazz)
Returns the class name as you would expect to see it in Java code.
|
static Class<?> |
getWrapperClass(Class<?> primitiveType)
Returns the wrapper class for the given primitive type.
|
static boolean |
isEqualsMethod(Method method)
Learn whether the specified method is/overrides
Object.equals(Object) . |
static boolean |
isHashCode(Method method)
Learn whether the specified method is/overrides
Object.hashCode() . |
static <T> T |
nullValue(Class<T> type)
Returns the proper "null value" as specified by the Java language.
|
static ProxyFactory |
proxyFactory()
Get a
ProxyFactory that delegates to discoverable ProxyFactory service providers. |
public static final Object[] EMPTY_ARGUMENTS
public static final Class<?>[] EMPTY_ARGUMENT_TYPES
public static Class<?>[] getAllInterfaces(Class<?> cls)
Gets an array of Class
objects representing all interfaces implemented by the given class and its
superclasses.
The order is determined by looking through each interface in turn as declared in the source file and following its hierarchy up. Then each superclass is considered in the same way. Later duplicates are ignored, so the order is maintained.
Note: Implementation of this method was "borrowed" from Apache Commons Lang to avoid a dependency.cls
- the class to look up, may be null
Class
objects representing all interfaces implemented by the given class and its
superclasses or null
if input class is null.public static String getJavaClassName(Class<?> clazz)
clazz
- the classpublic static Class<?> getWrapperClass(Class<?> primitiveType)
primitiveType
- the primitive typepublic static <T> T nullValue(Class<T> type)
type
- the typepublic static boolean isEqualsMethod(Method method)
Object.equals(Object)
.method
- to comparetrue
for a method with signature equals(Object)
public static boolean isHashCode(Method method)
Object.hashCode()
.method
- to comparehashCode()
public static ProxyFactory proxyFactory()
ProxyFactory
that delegates to discoverable ProxyFactory
service providers.ProxyFactory
Copyright © 2005–2014 The Apache Software Foundation. All rights reserved.