}
}
}
private <Psi extends PsiElement> PsiMethod createImplementingMethod(CandidateInfo candidateInfo, PsiClass psiClass, PsiAnnotation psiAnnotation) {
final PsiMethod methodToImplement = (PsiMethod) candidateInfo.getElement();
final PsiSubstitutor substitutor = candidateInfo.getSubstitutor();
if (null != methodToImplement && null != substitutor) {
final LombokPsiElementFactory lombokPsiElementFactory = LombokPsiElementFactory.getInstance();
final String methodName = methodToImplement.getName();
LombokLightMethodBuilder method = lombokPsiElementFactory.createLightMethod(psiClass.getManager(), methodName)
.withMethodReturnType(substitutor.substitute(methodToImplement.getReturnType()))
.withContainingClass(psiClass)
.withNavigationElement(psiAnnotation);
addModifier(methodToImplement, method, PsiModifier.PUBLIC);
addModifier(methodToImplement, method, PsiModifier.PACKAGE_LOCAL);
addModifier(methodToImplement, method, PsiModifier.PROTECTED);
for (PsiParameter psiParameter : methodToImplement.getParameterList().getParameters()) {
method.withParameter(psiParameter.getName(), substitutor.substitute(psiParameter.getType()));
}
for (PsiClassType psiClassType : methodToImplement.getThrowsList().getReferencedTypes()) {
method.withException(psiClassType);
}
return method;
}