public final class TypeUtil extends Object
Type
s and derivatives. This class is adapted heavily from the
Spring Framework, specifically the
TypeUtils
class.Type
,
GenericArrayType
,
ParameterizedType
,
WildcardType
,
Class
Modifier and Type | Method and Description |
---|---|
static List<Field> |
getAllDeclaredFields(Class<?> cls)
Gets all declared fields for the given class (including superclasses).
|
static boolean |
isAssignable(Type lhs,
Type rhs)
Indicates if two
Type s are assignment compatible. |
public static List<Field> getAllDeclaredFields(Class<?> cls)
cls
- the class to examineClass.getDeclaredFields()
public static boolean isAssignable(Type lhs, Type rhs)
Type
s are assignment compatible.lhs
- the left hand side to check assignability torhs
- the right hand side to check assignability fromtrue
if it is legal to assign a variable of type rhs
to a variable of type lhs
Class.isAssignableFrom(Class)
Copyright © 1999-2020 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.