Class ClassUtil
java.lang.Object
org.apache.camel.maven.packaging.generics.ClassUtil
Utility classes with respect to the class operations.
- Since:
- 1.0
- Author:
- Gurkan Erdogdu
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?> Gets the class of the given type arguments.static Class<?> Return raw class type for given type.static Class<?> getPrimitiveWrapper(Class<?> clazz) static booleanhasAnnotation(String fqAnnotationName, Class<?> cl) static booleanisClassAssignableFrom(Class<?> lhs, Class<?> rhs) Returns true if rhs is assignable type to the lhs, false otherwise.static booleanisParameterizedType(Type type) Returns true if type is an instance ofParameterizedTypeelse otherwise.static booleanisRawClassEquals(Type ipType, Type apiType) static booleanstatic booleanisWildCardType(Type type) Returns true if type is an instance ofWildcardTypeelse otherwise.
-
Field Details
-
PRIMITIVE_TO_WRAPPERS_MAP
-
NO_TYPES
-
-
Method Details
-
isSame
-
getPrimitiveWrapper
-
getClass
Gets the class of the given type arguments.If the given type
Typeparameters is an instance of theParameterizedType, it returns the raw type otherwise it return the castedClassof the type argument.- Parameters:
type- class or parametrized type
-
isParameterizedType
Returns true if type is an instance ofParameterizedTypeelse otherwise.- Parameters:
type- type of the artifact- Returns:
- true if type is an instance of
ParameterizedType
-
isWildCardType
Returns true if type is an instance ofWildcardTypeelse otherwise.- Parameters:
type- type of the artifact- Returns:
- true if type is an instance of
WildcardType
-
isClassAssignableFrom
Returns true if rhs is assignable type to the lhs, false otherwise.- Parameters:
lhs- left hand side classrhs- right hand side class- Returns:
- true if rhs is assignable to lhs
-
getClazz
Return raw class type for given type.- Parameters:
type- base type instance- Returns:
- class type for given type
-
isRawClassEquals
-
hasAnnotation
- Parameters:
fqAnnotationName- a fully qualified runtime annotation name whose presence on the given class is to be checkedcl- the class to check- Returns:
trueif the givenClassis annotated with the given runtime annotation;falseotherwise
-