void (Function<PsiField[], PsiField[]> equals, Function<PsiField[], PsiField[]> hashCode, Function<PsiField[], PsiField[]> nonNull, boolean insertOverride, boolean useAccessors) { JavaCodeStyleSettings.getInstance(getProject()).GENERATE_FINAL_LOCALS = true; JavaCodeStyleSettings.getInstance(getProject()).INSERT_OVERRIDE_ANNOTATION = insertOverride; PsiElement element = getFile().findElementAt(getEditor().getCaretModel().getOffset()); if (element == null) return; PsiClass aClass = PsiTreeUtil.getParentOfType(element, PsiClass.class); if (aClass == null) return; PsiField[] fields = aClass.getFields(); new GenerateEqualsHelper(getProject(), aClass, equals.fun(fields), hashCode.fun(fields), nonNull.fun(fields), false, useAccessors).invoke(); FileDocumentManager.getInstance().saveAllDocuments(); }