Class TypeUtil
java.lang.Object
org.apache.logging.log4j.plugins.util.TypeUtil
Utility class for working with Java
Type
s and derivatives. This class is adapted heavily from the
Spring Framework, specifically the
TypeUtils
class.- Since:
- 2.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Class<T>
getRawType
(Type type) Extracts the raw type equivalent of a given type.static Class<?>
getReferenceType
(Class<?> clazz) Returns the reference type for a class.static Type
getSuperclassTypeParameter
(Class<?> type) static boolean
isAssignable
(Type lhs, Type rhs) Indicates if twoType
s are assignment compatible.static boolean
-
Method Details
-
isAssignable
Indicates if twoType
s are assignment compatible.- Parameters:
lhs
- the left hand side to check assignability torhs
- the right hand side to check assignability from- Returns:
true
if it is legal to assign a variable of typerhs
to a variable of typelhs
- See Also:
-
getRawType
Extracts the raw type equivalent of a given type. -
getReferenceType
Returns the reference type for a class. For primitives, this is their boxed equivalent. For other types, this is the class unchanged. -
getSuperclassTypeParameter
-
isEqual
-