public static boolean resolvesTo(PsiType type, String fqn) { if (type instanceof PsiClassType) { final PsiClass resolved = ((PsiClassType) type).resolve(); return resolved != null && fqn.equals(resolved.getQualifiedName()); } return false; }
public static boolean isClassType(@Nullable PsiType type, @NotNull String qName) { if (type instanceof PsiClassType) { final PsiClass psiClass = ((PsiClassType) type).resolve(); return psiClass != null && qName.equals(psiClass.getQualifiedName()); } return false; }
public static PsiType unboxPrimitiveTypeWrapper(@Nullable PsiType type) { if (type instanceof PsiClassType) { final PsiClass psiClass = ((PsiClassType) type).resolve(); if (psiClass != null) { PsiType unboxed = ourQNameToUnboxed.get(psiClass.getQualifiedName()); if (unboxed != null) type = unboxed; } } return type; }
public static Map<String, PsiClass> getSuperClassesWithCache(@NotNull PsiClass aClass) { Map<String, PsiClass> superClassNames = PARENT_CACHE_KEY.getCachedValue(aClass); if (superClassNames == null) { Set<PsiClass> superClasses = new THashSet<PsiClass>(); superClasses.add(aClass); InheritanceUtil.getSuperClasses(aClass, superClasses, true); superClassNames = new LinkedHashMap<String, PsiClass>(); for (PsiClass superClass : superClasses) { superClassNames.put(superClass.getQualifiedName(), superClass); } superClassNames = PARENT_CACHE_KEY.putCachedValue(aClass, superClassNames); } return superClassNames; }