// Path: src/main/java/pl/mjedynak/idea/plugins/builder/factory/PsiElementClassMemberFactory.java
// public class PsiElementClassMemberFactory {
// 
//     public PsiElementClassMember createPsiElementClassMember(PsiField psiField) {
//         return new PsiFieldMember(psiField);
//     }
// }
// 
// Path: src/main/java/pl/mjedynak/idea/plugins/builder/verifier/PsiFieldVerifier.java
// public class PsiFieldVerifier {
// 
//     static final String PRIVATE_MODIFIER = "private";
//     static final String SET_PREFIX = "set";
//     static final String GET_PREFIX = "get";
// 
//     private CodeStyleSettings codeStyleSettings = new CodeStyleSettings();
// 
//     public boolean isSetInConstructor(PsiField psiField, PsiClass psiClass) {
//         boolean result = false;
//         PsiMethod[] constructors = psiClass.getConstructors();
//         for (int i = 0; i < constructors.length && !result; i++) {
//             result = checkConstructor(psiField, constructors[i]);
//         }
//         return result;
//     }
// 
//     public boolean checkConstructor(PsiField psiField, PsiMethod constructor) {
//         PsiParameterList parameterList = constructor.getParameterList();
//         PsiParameter[] parameters = parameterList.getParameters();
//         return iterateOverParameters(psiField, parameters);
//     }
// 
//     private boolean iterateOverParameters(PsiField psiField, PsiParameter[] parameters) {
//         boolean result = false;
//         for (int i = 0; i < parameters.length && !result; i++) {
//             result = checkParameter(psiField, parameters[i]);
//         }
//         return result;
//     }
// 
//     private boolean checkParameter(PsiField psiField, PsiParameter parameter) {
//         boolean result = false;
//         if (areNameAndTypeEqual(psiField, parameter)) {
//             result = true;
//         }
//         return result;
//     }
// 
//     public boolean areNameAndTypeEqual(PsiField psiField, PsiParameter parameter) {
//         String parameterNamePrefix = codeStyleSettings.getParameterNamePrefix();
//         String parameterName = parameter.getName();
//         String parameterNameWithoutPrefix = parameterName.replace(parameterNamePrefix, "");
//         String fieldNamePrefix = codeStyleSettings.getFieldNamePrefix();
//         String fieldName = psiField.getName();
//         String fieldNameWithoutPrefix = fieldName.replaceFirst(fieldNamePrefix, "");
//         return parameterNameWithoutPrefix.equals(fieldNameWithoutPrefix) && parameter.getType().equals(psiField.getType());
//     }
// 
//     public boolean isSetInSetterMethod(PsiField psiField, PsiClass psiClass) {
//         return methodIsNotPrivateAndHasProperPrefixAndProperName(psiField, psiClass, SET_PREFIX);
//     }
// 
//     public boolean hasGetterMethod(PsiField psiField, PsiClass psiClass) {
//         return methodIsNotPrivateAndHasProperPrefixAndProperName(psiField, psiClass, GET_PREFIX);
//     }
// 
//     private boolean methodIsNotPrivateAndHasProperPrefixAndProperName(PsiField psiField, PsiClass psiClass, String prefix) {
//         boolean result = false;
//         for (PsiMethod method : psiClass.getAllMethods()) {
//             if (methodIsNotPrivate(method) && methodHaProperPrefixAndProperName(psiField, method, prefix)) {
//                 result = true;
//                 break;
//             }
//         }
//         return result;
//     }
// 
//     private boolean methodIsNotPrivate(PsiMethod method) {
//         PsiModifierList modifierList = method.getModifierList();
//         return modifierListHasNoPrivateModifier(modifierList);
//     }
// 
//     private boolean methodHaProperPrefixAndProperName(PsiField psiField, PsiMethod method, String prefix) {
//         String fieldNamePrefix = codeStyleSettings.getFieldNamePrefix();
//         String fieldNameWithoutPrefix = psiField.getName().replace(fieldNamePrefix, EMPTY);
//         return method.getName().equals(prefix + WordUtils.capitalize(fieldNameWithoutPrefix));
//     }
// 
//     private boolean modifierListHasNoPrivateModifier(PsiModifierList modifierList) {
//         return !modifierList.hasExplicitModifier(PRIVATE_MODIFIER);
//     }
// 
// }


import com.intellij.codeInsight.generation.PsiElementClassMember;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiField;
import pl.mjedynak.idea.plugins.builder.factory.PsiElementClassMemberFactory;
import pl.mjedynak.idea.plugins.builder.verifier.PsiFieldVerifier;
import java.util.ArrayList;
import java.util.List;
import static java.util.Arrays.stream;
import static java.util.stream.Collectors.toList;

package pl.mjedynak.idea.plugins.builder.psi;




public class PsiFieldSelector {

    private PsiElementClassMemberFactory psiElementClassMemberFactory;

// Path: src/main/java/pl/mjedynak/idea/plugins/builder/factory/PsiElementClassMemberFactory.java
// public class PsiElementClassMemberFactory {
// 
//     public PsiElementClassMember createPsiElementClassMember(PsiField psiField) {
//         return new PsiFieldMember(psiField);
//     }
// }
// 
// Path: src/main/java/pl/mjedynak/idea/plugins/builder/verifier/PsiFieldVerifier.java
// public class PsiFieldVerifier {
// 
//     static final String PRIVATE_MODIFIER = "private";
//     static final String SET_PREFIX = "set";
//     static final String GET_PREFIX = "get";
// 
//     private CodeStyleSettings codeStyleSettings = new CodeStyleSettings();
// 
//     public boolean isSetInConstructor(PsiField psiField, PsiClass psiClass) {
//         boolean result = false;
//         PsiMethod[] constructors = psiClass.getConstructors();
//         for (int i = 0; i < constructors.length && !result; i++) {
//             result = checkConstructor(psiField, constructors[i]);
//         }
//         return result;
//     }
// 
//     public boolean checkConstructor(PsiField psiField, PsiMethod constructor) {
//         PsiParameterList parameterList = constructor.getParameterList();
//         PsiParameter[] parameters = parameterList.getParameters();
//         return iterateOverParameters(psiField, parameters);
//     }
// 
//     private boolean iterateOverParameters(PsiField psiField, PsiParameter[] parameters) {
//         boolean result = false;
//         for (int i = 0; i < parameters.length && !result; i++) {
//             result = checkParameter(psiField, parameters[i]);
//         }
//         return result;
//     }
// 
//     private boolean checkParameter(PsiField psiField, PsiParameter parameter) {
//         boolean result = false;
//         if (areNameAndTypeEqual(psiField, parameter)) {
//             result = true;
//         }
//         return result;
//     }
// 
//     public boolean areNameAndTypeEqual(PsiField psiField, PsiParameter parameter) {
//         String parameterNamePrefix = codeStyleSettings.getParameterNamePrefix();
//         String parameterName = parameter.getName();
//         String parameterNameWithoutPrefix = parameterName.replace(parameterNamePrefix, "");
//         String fieldNamePrefix = codeStyleSettings.getFieldNamePrefix();
//         String fieldName = psiField.getName();
//         String fieldNameWithoutPrefix = fieldName.replaceFirst(fieldNamePrefix, "");
//         return parameterNameWithoutPrefix.equals(fieldNameWithoutPrefix) && parameter.getType().equals(psiField.getType());
//     }
// 
//     public boolean isSetInSetterMethod(PsiField psiField, PsiClass psiClass) {
//         return methodIsNotPrivateAndHasProperPrefixAndProperName(psiField, psiClass, SET_PREFIX);
//     }
// 
//     public boolean hasGetterMethod(PsiField psiField, PsiClass psiClass) {
//         return methodIsNotPrivateAndHasProperPrefixAndProperName(psiField, psiClass, GET_PREFIX);
//     }
// 
//     private boolean methodIsNotPrivateAndHasProperPrefixAndProperName(PsiField psiField, PsiClass psiClass, String prefix) {
//         boolean result = false;
//         for (PsiMethod method : psiClass.getAllMethods()) {
//             if (methodIsNotPrivate(method) && methodHaProperPrefixAndProperName(psiField, method, prefix)) {
//                 result = true;
//                 break;
//             }
//         }
//         return result;
//     }
// 
//     private boolean methodIsNotPrivate(PsiMethod method) {
//         PsiModifierList modifierList = method.getModifierList();
//         return modifierListHasNoPrivateModifier(modifierList);
//     }
// 
//     private boolean methodHaProperPrefixAndProperName(PsiField psiField, PsiMethod method, String prefix) {
//         String fieldNamePrefix = codeStyleSettings.getFieldNamePrefix();
//         String fieldNameWithoutPrefix = psiField.getName().replace(fieldNamePrefix, EMPTY);
//         return method.getName().equals(prefix + WordUtils.capitalize(fieldNameWithoutPrefix));
//     }
// 
//     private boolean modifierListHasNoPrivateModifier(PsiModifierList modifierList) {
//         return !modifierList.hasExplicitModifier(PRIVATE_MODIFIER);
//     }
// 
// }


// Path: src/main/java/pl/mjedynak/idea/plugins/builder/psi/PsiFieldSelector.java
import com.intellij.codeInsight.generation.PsiElementClassMember;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiField;
import pl.mjedynak.idea.plugins.builder.factory.PsiElementClassMemberFactory;
import pl.mjedynak.idea.plugins.builder.verifier.PsiFieldVerifier;
import java.util.ArrayList;
import java.util.List;
import static java.util.Arrays.stream;
import static java.util.stream.Collectors.toList;

package pl.mjedynak.idea.plugins.builder.psi;




public class PsiFieldSelector {

    private PsiElementClassMemberFactory psiElementClassMemberFactory;

    private PsiFieldVerifier psiFieldVerifier;
