public static boolean isAssignable ( TypeName typeName , Class < ? > assignableClazz ) { try { if ( typeName instanceof ParameterizedTypeName ) { typeName = ( ( ParameterizedTypeName ) typeName ) . rawType ; } else if ( typeName instanceof ArrayTypeName ) { typeName = ( ( ArrayTypeName ) typeName ) . componentType ; } Class < ? > resolvedType = Class . forName ( typeName . toString ( ) ) ; return assignableClazz . isAssignableFrom ( resolvedType ) ; } catch ( ClassNotFoundException e ) { return false ; } }
Checks if is assignable .