return result;
}
@NotNull
private PsiMethod generateDelegateMethod(@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation, @NotNull PsiMethod psiMethod, @Nullable PsiSubstitutor psiSubstitutor) {
final PsiType returnType = null == psiSubstitutor ? psiMethod.getReturnType() : psiSubstitutor.substitute(psiMethod.getReturnType());
LombokLightMethodBuilder methodBuilder = LombokPsiElementFactory.getInstance().
createLightMethod(psiClass.getManager(), psiMethod.getName())
.withModifier(PsiModifier.PUBLIC)
.withMethodReturnType(returnType)
.withContainingClass(psiClass)
.withNavigationElement(psiAnnotation);
for (PsiTypeParameter typeParameter : psiMethod.getTypeParameters()) {
methodBuilder.withTypeParameter(new LightTypeParameter(typeParameter));
}
final PsiParameterList parameterList = psiMethod.getParameterList();
int parameterIndex = 0;
for (PsiParameter psiParameter : parameterList.getParameters()) {
final PsiType psiParameterType = null == psiSubstitutor ? psiParameter.getType() : psiSubstitutor.substitute(psiParameter.getType());
String psiParameterName = psiParameter.getName();
methodBuilder.withParameter(StringUtils.defaultIfEmpty(psiParameterName, "p" + parameterIndex), psiParameterType);
parameterIndex++;
}