@Test public void isComponentClass() { PsiClass component = createSubclassOf("com.facebook.litho.Component"); Assert.assertTrue(LithoPluginUtils.isComponentClass(component)); Assert.assertTrue(LithoPluginUtils.isGeneratedClass(component)); PsiClass notComponent = createSubclassOf("com.facebook.litho.Column"); Assert.assertFalse(LithoPluginUtils.isComponentClass(notComponent)); Assert.assertFalse(LithoPluginUtils.isGeneratedClass(notComponent)); }
public static boolean isComponentClass(@Nullable PsiClass psiClass) { return psiClass != null && psiClass.getSuperClass() != null && ("ComponentLifecycle".equals(psiClass.getSuperClass().getName()) || "com.facebook.litho.Component".equals(psiClass.getSuperClass().getQualifiedName())); }
LithoPluginUtils { public static boolean isComponentClass(@Nullable PsiClass psiClass) { return psiClass != null && psiClass.getSuperClass() != null && ("ComponentLifecycle".equals(psiClass.getSuperClass().getName()) || "com.facebook.litho.Component".equals(psiClass.getSuperClass().getQualifiedName())); } }
LithoPluginUtils { public static boolean isComponentClass(@Nullable PsiClass psiClass) { return psiClass != null && psiClass.getSuperClass() != null && ("ComponentLifecycle".equals(psiClass.getSuperClass().getName()) || "com.facebook.litho.Component".equals(psiClass.getSuperClass().getQualifiedName())); }  }
LithoPluginUtils { public static boolean isComponentClass(@Nullable PsiClass psiClass) { return psiClass != null && psiClass.getSuperClass() != null && ("ComponentLifecycle".equals(psiClass.getSuperClass().getName()) || "com.facebook.litho.Component".equals(psiClass.getSuperClass().getQualifiedName())); }  static boolean isComponentClass(@Nullable PsiClass psiClass); static boolean isSectionClass(@Nullable PsiClass psiClass); static boolean isGeneratedClass(@Nullable PsiClass psiClass); static boolean isLithoSpec(@Nullable PsiFile psiFile); static boolean isLithoSpec(@Nullable PsiClass psiClass); static boolean isLayoutSpec(@Nullable PsiClass psiClass); static boolean isMountSpec(@Nullable PsiClass psiClass); static boolean hasLithoComponentSpecAnnotation(@Nullable PsiClass psiClass); static boolean hasLithoSectionSpecAnnotation(PsiClass psiClass); @Contract("null -> false") static boolean isSpecName(@Nullable String clsName); static boolean isPropOrState(PsiParameter parameter); static boolean isProp(PsiParameter parameter); static boolean isState(PsiParameter parameter); static boolean isParam(PsiParameter parameter); static boolean isPropDefault(PsiField field); static boolean isEvent(PsiClass psiClass); @Nullable @Contract("null -> null") static String getLithoComponentNameFromSpec(@Nullable String specName); @Nullable @Contract("null -> null; !null -> !null") static String getLithoComponentSpecNameFromComponent(@Nullable String componentName); static Stream<PsiParameter> getPsiParameterStream(
      @Nullable PsiMethod currentMethod, PsiMethod[] allMethods); static Optional<PsiClass> getFirstLayoutSpec(PsiFile psiFile); static Optional<PsiClass> getFirstClass(PsiFile psiFile, Predicate<PsiClass> classFilter); static void showInfo(String infoMessage, @Nullable Project project); static void showWarning(String infoMessage, @Nullable Project project); @Nullable static String resolveEventName(PsiMethodCallExpression methodCall); }
LithoPluginUtils { public static boolean isComponentClass(@Nullable PsiClass psiClass) { return psiClass != null && psiClass.getSuperClass() != null && ("ComponentLifecycle".equals(psiClass.getSuperClass().getName()) || "com.facebook.litho.Component".equals(psiClass.getSuperClass().getQualifiedName())); }  static boolean isComponentClass(@Nullable PsiClass psiClass); static boolean isSectionClass(@Nullable PsiClass psiClass); static boolean isGeneratedClass(@Nullable PsiClass psiClass); static boolean isLithoSpec(@Nullable PsiFile psiFile); static boolean isLithoSpec(@Nullable PsiClass psiClass); static boolean isLayoutSpec(@Nullable PsiClass psiClass); static boolean isMountSpec(@Nullable PsiClass psiClass); static boolean hasLithoComponentSpecAnnotation(@Nullable PsiClass psiClass); static boolean hasLithoSectionSpecAnnotation(PsiClass psiClass); @Contract("null -> false") static boolean isSpecName(@Nullable String clsName); static boolean isPropOrState(PsiParameter parameter); static boolean isProp(PsiParameter parameter); static boolean isState(PsiParameter parameter); static boolean isParam(PsiParameter parameter); static boolean isPropDefault(PsiField field); static boolean isEvent(PsiClass psiClass); @Nullable @Contract("null -> null") static String getLithoComponentNameFromSpec(@Nullable String specName); @Nullable @Contract("null -> null; !null -> !null") static String getLithoComponentSpecNameFromComponent(@Nullable String componentName); static Stream<PsiParameter> getPsiParameterStream(
      @Nullable PsiMethod currentMethod, PsiMethod[] allMethods); static Optional<PsiClass> getFirstLayoutSpec(PsiFile psiFile); static Optional<PsiClass> getFirstClass(PsiFile psiFile, Predicate<PsiClass> classFilter); static void showInfo(String infoMessage, @Nullable Project project); static void showWarning(String infoMessage, @Nullable Project project); @Nullable static String resolveEventName(PsiMethodCallExpression methodCall);  }