public String buildBeanClass() {
    boolean recordsAvailable = PsiUtil.isAvailable(JavaFeature.RECORDS, myFile) &&
                               !ContainerUtil.exists(fields, ParameterSpec::isSetterRequired);
    @NonNls final StringBuilder out = new StringBuilder(1024);
    if (packageName.length() > 0) out.append("package ").append(packageName).append(';');
    out.append('\n');
    out.append(myVisibility).append(" ");
    out.append(recordsAvailable ? PsiKeyword.RECORD : PsiKeyword.CLASS);
    out.append(" ").append(className);
    if (!typeParams.isEmpty()) {
      out.append('<');
      boolean first = true;
      for (PsiTypeParameter typeParam : typeParams) {
        if (!first) {
          out.append(',');
        }
        out.append(typeParam.getText());
        first = false;
      }
      out.append('>');
    }


    if (recordsAvailable) {
      out.append("(");
      StringUtil.join(fields, param -> {
        PsiType type = param.getType();
        if (param.getParameter().isVarArgs() && type instanceof PsiArrayType) {
          type = new PsiEllipsisType(((PsiArrayType)type).getComponentType(), type.getAnnotations());
        }
        return type.getCanonicalText(true) + " " + param.getName();
      }, ", ", out);
      out.append("){}");
    }
    else {

      out.append('\n');

      out.append('{');
      outputFields(out);
      outputConstructor(out);
      outputGetters(out);
      outputSetters(out);
      out.append("}\n");
    }
    return out.toString();
  }
public String buildBeanClass()