Class TypeUtil
java.lang.Object
org.apache.logging.log4j.core.util.TypeUtil
Utility class for working with Java
Types and derivatives. This class is adapted heavily from the
Spring Framework, specifically the
TypeUtils
class.- Since:
- 2.1
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllDeclaredFields(Class<?> cls) Gets all declared fields for the given class (including superclasses).private static Type[]private static Type[]static booleanisAssignable(Type lhs, Type rhs) Indicates if twoTypes are assignment compatible.private static booleanisBoundAssignable(Type lhs, Type rhs) private static booleanprivate static booleanisWildcardAssignable(WildcardType lhs, Type rhs)
-
Constructor Details
-
TypeUtil
private TypeUtil()
-
-
Method Details
-
getAllDeclaredFields
Gets all declared fields for the given class (including superclasses).- Parameters:
cls- the class to examine- Returns:
- all declared fields for the given class (including superclasses).
- See Also:
-
isAssignable
Indicates if twoTypes are assignment compatible.- Parameters:
lhs- the left hand side to check assignability torhs- the right hand side to check assignability from- Returns:
trueif it is legal to assign a variable of typerhsto a variable of typelhs- See Also:
-
isParameterizedAssignable
-
isWildcardAssignable
-
getEffectiveUpperBounds
-
getEffectiveLowerBounds
-
isBoundAssignable
-