LightMethodBuilder (@NotNull LightPsiClassBuilder builderClass, @NotNull PsiVariable field, @NotNull PsiAnnotation annotation, int currentField) { final String name = Objects.requireNonNull(field.getName()); final LightMethodBuilder fieldSetter = new LightMethodBuilder(builderClass.getManager(), getFieldMethodName(annotation, name)); final PsiSubstitutor substitutor = PsiSubstitutor.EMPTY.put( builderClass.getTypeParameters()[currentField], myElementFactory.createTypeByFQClassName(SET_FQN, annotation.getResolveScope()) ); fieldSetter.addModifier(PsiModifier.PUBLIC); fieldSetter.addParameter(name, field.getType()); fieldSetter.setContainingClass(builderClass); fieldSetter.setMethodReturnType(myElementFactory.createType(builderClass, substitutor)); fieldSetter.setNavigationElement(field); fieldSetter.setOriginInfo(ORIGIN_INFO); return fieldSetter; }