LombokLightClassBuilder (@NotNull String name, @NotNull PsiClass containingClass, @NotNull String accessLevel, @NotNull PsiElement navigationElement) { final String innerClassQualifiedName = containingClass.getQualifiedName() + "." + name; final LombokLightClassBuilder lazyClassBuilder = new LombokLightClassBuilder(containingClass, name, innerClassQualifiedName); lazyClassBuilder.withContainingClass(containingClass) .withNavigationElement(navigationElement) .withEnum(true) .withModifier(accessLevel) .withImplicitModifier(PsiModifier.STATIC) .withImplicitModifier(PsiModifier.FINAL); lazyClassBuilder.withMethodSupplier((thisPsiClass)-> { //add enum methods like here: ClassInnerStuffCache.calcMethods final PsiManager psiManager = containingClass.getManager(); final PsiClassType enumClassType = PsiClassUtil.getTypeWithGenerics(thisPsiClass); // "public static " + myClass.getName() + "[] values() { }" final LombokLightMethodBuilder valuesEnumMethod = new LombokLightMethodBuilder(psiManager, "values") .withModifier(PsiModifier.PUBLIC) .withModifier(PsiModifier.STATIC) .withContainingClass(containingClass) .withNavigationElement(navigationElement) .withMethodReturnType(new PsiArrayType(enumClassType)) .withBodyText(""); // "public static " + myClass.getName() + " valueOf(java.lang.String name) throws java.lang.IllegalArgumentException { }" final LombokLightMethodBuilder valueOfEnumMethod = new LombokLightMethodBuilder(psiManager, "valueOf") .withModifier(PsiModifier.PUBLIC) .withModifier(PsiModifier.STATIC) .withContainingClass(containingClass) .withNavigationElement(navigationElement) .withParameter("name", PsiType.getJavaLangString(psiManager, containingClass.getResolveScope())) .withException(PsiType.getTypeByName("java.lang.IllegalArgumentException", containingClass.getProject(), containingClass.getResolveScope())) .withMethodReturnType(enumClassType) .withBodyText(""); return List.of(valuesEnumMethod, valueOfEnumMethod); }); return lazyClassBuilder; }