public static boolean isTargetType(TypeElement typeElement, String target) {
        Logger.debug("Checking typeElement: %s", typeElement);
        TypeMirror typeMirror = typeElement.getSuperclass();
        if (typeMirror.toString().equals(target)) return true;
        TypeMirror superMirror = asTypeElement(typeMirror).getSuperclass();
        while (superMirror != null) {
            typeMirror = superMirror;
            Logger.debug("isTargetType: %s, %s", target, typeMirror);
            if (typeMirror.toString().equals(target)) return true;
            try {
                superMirror = asTypeElement(typeMirror).getSuperclass();
            } catch (Throwable e) {
                break;
            }
        }
        return false;
    }
Utilities related to {@link TypeMirror} instances.

@author Gregory Kick
@since 2.0
android/annotation_processors/permission-requester-compiler/src/main/java/github/tornaco/permission/compiler/common/MoreTypes.java