String (@NotNull PsiField psiField, @NotNull PsiClass psiClass, PsiType returnType, boolean isStatic, PsiParameter methodParameter) { final String blockText; final String thisOrClass = isStatic ? psiClass.getName() : "this"; blockText = String.format("%s.%s = %s; ", thisOrClass, psiField.getName(), methodParameter.getName()); String codeBlockText = blockText; if (!isStatic && !PsiTypes.voidType().equals(returnType)) { codeBlockText += "return this;"; } return codeBlockText; }