Class ClassUtils
java.lang.Object
io.smallrye.reactive.messaging.providers.helpers.ClassUtils
Allows checking if a class can be assigned to a variable from another class.
Code extracted from from Apache Commons Lang 3 - ClassUtils.java
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisAssignable(Class<?> cls, Class<?> toClass) Checks if oneclscan be assigned to a variable of anothertoClass, like:Cls c = ...; ToClass x = c;static Class<?>primitiveToWrapper(Class<?> cls) Converts the specified primitive Class object to its corresponding wrapper Class object.
-
Method Details
-
isAssignable
Checks if oneclscan be assigned to a variable of anothertoClass, like:Cls c = ...; ToClass x = c;- Parameters:
cls- the Class to check, may benulltoClass- the Class to try to assign into, returnsfalseif null- Returns:
trueif assignment possible
-
primitiveToWrapper
Converts the specified primitive Class object to its corresponding wrapper Class object.
NOTE: From v2.2, this method handles
Void.TYPE, returningVoid.TYPE.- Parameters:
cls- the class to convert, may be null- Returns:
- the wrapper class for
clsorclsifclsis not a primitive.nullif null input. - Since:
- 2.1
-