Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
13,100
boolean (@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation, @NotNull ProblemSink problemSink) { boolean result = validateAnnotationOnRightType(psiClass, psiAnnotation, problemSink); if (result) { final Project project = psiAnnotation.getProject(); final String builderClassName = getBuilderClassName(psiCl...
validate
13,101
boolean (@NotNull PsiClass psiClass, Collection<BuilderInfo> builderInfos, @NotNull ProblemSink problemSink) { if (PsiAnnotationSearchUtil.isAnnotatedWith(psiClass, LombokClassNames.NO_ARGS_CONSTRUCTOR) && PsiAnnotationSearchUtil.isNotAnnotatedWith(psiClass, LombokClassNames.ALL_ARGS_CONSTRUCTOR)) { if (PsiAnnotationSe...
validateBuilderConstructor
13,102
boolean (@NotNull Collection<BuilderInfo> builderInfos, @NotNull ProblemSink problemSink) { final Optional<BuilderInfo> anyBuilderDefaultAndSingulars = builderInfos.stream() .filter(BuilderInfo::hasBuilderDefaultAnnotation) .filter(BuilderInfo::hasSingularAnnotation).findAny(); anyBuilderDefaultAndSingulars.ifPresent(b...
validateBuilderDefault
13,103
boolean (@NotNull PsiMethod psiMethod, @NotNull PsiAnnotation psiAnnotation, @NotNull ProblemSink problemSink) { final PsiClass psiClass = psiMethod.getContainingClass(); boolean result = null != psiClass; if (result) { final String builderClassName = getBuilderClassName(psiClass, psiAnnotation, psiMethod); final Proje...
validate
13,104
boolean (Collection<BuilderInfo> builderInfos, @NotNull ProblemSink problemSink) { builderInfos.stream().filter(BuilderInfo::hasSingularAnnotation).forEach(builderInfo -> { final PsiType psiVariableType = builderInfo.getVariable().getType(); String qualifiedName = null; if (psiVariableType instanceof PsiClassReferenceT...
validateSingular
13,105
boolean (@NotNull String builderClassName, @NotNull Project project, @NotNull ProblemSink builder) { final PsiNameHelper psiNameHelper = PsiNameHelper.getInstance(project); if (!psiNameHelper.isIdentifier(builderClassName)) { builder.addErrorMessage("inspection.message.s.not.valid.identifier", builderClassName); return...
validateBuilderIdentifier
13,106
boolean (@NotNull String builderClassName, @NotNull PsiClass psiClass, @NotNull ProblemSink problemSink) { final Optional<PsiClass> optionalPsiClass = PsiClassUtil.getInnerClassInternByName(psiClass, builderClassName); return optionalPsiClass.map(builderClass -> validateInvalidAnnotationsOnBuilderClass(builderClass, pr...
validateExistingBuilderClass
13,107
boolean (@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation, @NotNull ProblemSink builder) { if (psiClass.isAnnotationType() || psiClass.isInterface() || psiClass.isEnum()) { builder.addErrorMessage("inspection.message.s.can.be.used.on.classes.only", psiAnnotation.getQualifiedName()); return false; } retu...
validateAnnotationOnRightType
13,108
boolean (Stream<BuilderInfo> builderInfos, @NotNull ProblemSink problemSink) { builderInfos.map(BuilderInfo::withObtainVia) .filter(BuilderInfo::hasObtainViaAnnotation) .forEach(builderInfo -> { if (StringUtil.isEmpty(builderInfo.getViaFieldName()) == StringUtil.isEmpty(builderInfo.getViaMethodName())) { problemSink.ad...
validateObtainViaAnnotations
13,109
Optional<PsiClass> (@NotNull PsiClass psiClass, @Nullable PsiMethod psiMethod, @NotNull PsiAnnotation psiAnnotation) { final String builderClassName = getBuilderClassName(psiClass, psiAnnotation, psiMethod); return PsiClassUtil.getInnerClassInternByName(psiClass, builderClassName); }
getExistInnerBuilderClass
13,110
String (@NotNull PsiAnnotation psiAnnotation) { final String buildMethodName = PsiAnnotationUtil.getStringAnnotationValue(psiAnnotation, ANNOTATION_BUILD_METHOD_NAME, BUILD_METHOD_NAME); return StringUtil.isEmptyOrSpaces(buildMethodName) ? BUILD_METHOD_NAME : buildMethodName; }
getBuildMethodName
13,111
String (@NotNull PsiAnnotation psiAnnotation) { final String builderMethodName = PsiAnnotationUtil.getStringAnnotationValue(psiAnnotation, ANNOTATION_BUILDER_METHOD_NAME, BUILDER_METHOD_NAME); return null == builderMethodName ? BUILDER_METHOD_NAME : builderMethodName; }
getBuilderMethodName
13,112
String (@NotNull PsiAnnotation psiAnnotation) { final String setterPrefix = PsiAnnotationUtil.getStringAnnotationValue(psiAnnotation, ANNOTATION_SETTER_PREFIX, ""); return null == setterPrefix ? "" : setterPrefix; }
getSetterPrefix
13,113
String (@NotNull PsiAnnotation psiAnnotation) { final String accessVisibility = LombokProcessorUtil.getAccessVisibility(psiAnnotation); return null == accessVisibility ? PsiModifier.PUBLIC : accessVisibility; }
getBuilderOuterAccessVisibility
13,114
String (@NotNull PsiAnnotation psiAnnotation) { final String accessVisibility = getBuilderOuterAccessVisibility(psiAnnotation); return PsiModifier.PROTECTED.equals(accessVisibility) ? PsiModifier.PUBLIC : accessVisibility; }
getBuilderInnerAccessVisibility
13,115
String (@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation) { return getBuilderClassName(psiClass, psiAnnotation, null); }
getBuilderClassName
13,116
String (@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation, @Nullable PsiMethod psiMethod) { final String builderClassName = PsiAnnotationUtil.getStringAnnotationValue(psiAnnotation, ANNOTATION_BUILDER_CLASS_NAME, ""); if (!StringUtil.isEmptyOrSpaces(builderClassName)) { return builderClassName; } String ...
getBuilderClassName
13,117
String (@NotNull PsiClass psiClass, String returnTypeName) { final ConfigDiscovery configDiscovery = ConfigDiscovery.getInstance(); final String builderClassNamePattern = configDiscovery.getStringLombokConfigProperty(BUILDER_CLASS_NAME, psiClass); return replace(builderClassNamePattern, "*", capitalize(returnTypeName))...
getBuilderClassName
13,118
Collection<PsiMethod> (@NotNull PsiClass containingClass, @Nullable PsiMethod psiMethod, @NotNull PsiClass builderPsiClass, @NotNull PsiAnnotation psiAnnotation) { final List<BuilderInfo> builderInfos = createBuilderInfos(psiAnnotation, containingClass, psiMethod, builderPsiClass); return builderInfos.stream() .filter(...
createBuilderDefaultProviderMethodsIfNecessary
13,119
PsiMethod (@NotNull BuilderInfo info) { final PsiClass builderClass = info.getBuilderClass(); final PsiClass containingClass = builderClass.getContainingClass(); final String blockText = String.format("return %s;", info.getFieldInitializer().getText()); return new LombokLightMethodBuilder(builderClass.getManager(), inf...
createBuilderDefaultProviderMethod
13,120
Optional<PsiMethod> (@NotNull PsiClass containingClass, @Nullable PsiMethod psiMethod, @NotNull PsiClass builderPsiClass, @NotNull PsiAnnotation psiAnnotation) { final String builderMethodName = getBuilderMethodName(psiAnnotation); if (!builderMethodName.isEmpty() && !hasMethod(containingClass, builderMethodName)) { fi...
createBuilderMethodIfNecessary
13,121
Optional<PsiMethod> (@NotNull PsiClass containingClass, @Nullable PsiMethod psiMethod, @NotNull PsiClass builderPsiClass, @NotNull PsiAnnotation psiAnnotation) { if (!PsiAnnotationUtil.getBooleanAnnotationValue(psiAnnotation, TO_BUILDER_ANNOTATION_KEY, false)) { return Optional.empty(); } final List<BuilderInfo> builde...
createToBuilderMethodIfNecessary
13,122
PsiType (@NotNull List<BuilderInfo> builderInfos, PsiClass builderPsiClass, PsiClass psiClass) { final PsiElementFactory factory = JavaPsiFacade.getElementFactory(psiClass.getProject()); final PsiType[] psiTypes = builderInfos.stream() .map(BuilderInfo::getObtainViaFieldVariableType) .filter(Optional::isPresent) .map(O...
calculateResultType
13,123
Stream<BuilderInfo> (@NotNull PsiClass psiClass, @Nullable PsiMethod psiClassMethod) { final Stream<BuilderInfo> result; if (null != psiClassMethod) { result = Arrays.stream(psiClassMethod.getParameterList().getParameters()).map(BuilderInfo::fromPsiParameter); } else if (psiClass.isRecord()) { result = Arrays.stream(ps...
createBuilderInfos
13,124
List<BuilderInfo> (@NotNull PsiAnnotation psiAnnotation, @NotNull PsiClass psiClass, @Nullable PsiMethod psiClassMethod, @NotNull PsiClass builderClass) { final PsiSubstitutor builderSubstitutor = getBuilderSubstitutor(psiClass, builderClass); final String accessVisibility = getBuilderInnerAccessVisibility(psiAnnotatio...
createBuilderInfos
13,125
PsiClass (@NotNull PsiClass psiClass, @Nullable PsiMethod psiMethod, @NotNull PsiAnnotation psiAnnotation) { final LombokLightClassBuilder builderClass; if (null != psiMethod) { builderClass = createEmptyBuilderClass(psiClass, psiMethod, psiAnnotation); } else { builderClass = createEmptyBuilderClass(psiClass, psiAnnot...
createBuilderClass
13,126
boolean (@NotNull PsiClass psiClass, @Nullable PsiMethod psiMethod) { final boolean hasJacksonizedAnnotation = PsiAnnotationSearchUtil.isAnnotatedWith(null == psiMethod ? psiClass : psiMethod, LombokClassNames.JACKSONIZED); return hasJacksonizedAnnotation && JacksonizedProcessor.validateAnnotationOwner(null == psiMetho...
hasValidJacksonizedAnnotation
13,127
void (@NotNull PsiClass psiClass, @Nullable PsiMethod psiMethod, @NotNull PsiAnnotation psiAnnotation, @NotNull LombokLightClassBuilder builderClass) { //Annotation 'com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder=Foobar.FoobarBuilder[Impl].class)' should be added on PsiClass psiClass.putUserData(Lomb...
handleJacksonized
13,128
PsiAnnotation (@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation) { final StringBuilder parameters = new StringBuilder(); final String setterPrefix = getSetterPrefix(psiAnnotation); parameters.append("withPrefix=\""); parameters.append(setterPrefix); parameters.append('"'); parameters.append(','); final ...
createPojoBuilderAnnotation
13,129
LombokLightClassBuilder (@NotNull PsiClass psiClass, @NotNull PsiMethod psiMethod, @NotNull PsiAnnotation psiAnnotation) { return createBuilderClass(psiClass, psiMethod, psiMethod.isConstructor() || psiMethod.hasModifierProperty(PsiModifier.STATIC), psiAnnotation); }
createEmptyBuilderClass
13,130
LombokLightClassBuilder (@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation) { return createBuilderClass(psiClass, psiClass, true, psiAnnotation); }
createEmptyBuilderClass
13,131
Optional<PsiClass> (@NotNull PsiClass psiClass, @Nullable PsiMethod psiMethod, @NotNull PsiAnnotation psiAnnotation) { PsiClass builderClass = null; if (getExistInnerBuilderClass(psiClass, psiMethod, psiAnnotation).isEmpty()) { builderClass = createBuilderClass(psiClass, psiMethod, psiAnnotation); } return Optional.ofN...
createBuilderClassIfNotExist
13,132
PsiMethod (@NotNull PsiAnnotation psiAnnotation, @NotNull PsiClass builderClass) { return createToStringMethod(psiAnnotation, builderClass, false); }
createToStringMethod
13,133
boolean (@NotNull PsiField psiField) { boolean isBuilderDefaultSetter = false; if (psiField.getName().endsWith("$set") && PsiTypes.booleanType().equals(psiField.getType())) { PsiElement navigationElement = psiField.getNavigationElement(); if (navigationElement instanceof PsiField) { isBuilderDefaultSetter = PsiAnnotati...
isNotBuilderDefaultSetterFields
13,134
LombokLightClassBuilder (@NotNull PsiClass psiClass, @NotNull PsiTypeParameterListOwner psiTypeParameterListOwner, final boolean isStatic, @NotNull PsiAnnotation psiAnnotation) { PsiMethod psiMethod = null; if (psiTypeParameterListOwner instanceof PsiMethod) { psiMethod = (PsiMethod)psiTypeParameterListOwner; } final S...
createBuilderClass
13,135
Collection<PsiMethod> (@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation) { final Collection<PsiMethod> methodsIntern = PsiClassUtil.collectClassConstructorIntern(psiClass); final NoArgsConstructorProcessor noArgsConstructorProcessor = getNoArgsConstructorProcessor(); final String constructorName = noArg...
createConstructors
13,136
PsiMethod (@NotNull PsiAnnotation psiAnnotation, @NotNull PsiClass parentClass, @Nullable PsiMethod psiMethod, @NotNull PsiClass builderClass, @NotNull String buildMethodName, List<BuilderInfo> builderInfos) { final PsiType builderType = getReturnTypeOfBuildMethod(parentClass, psiMethod); final PsiSubstitutor builderSu...
createBuildMethod
13,137
Optional<PsiMethod> (@NotNull PsiClass parentClass, Collection<BuilderInfo> builderInfos) { final Collection<PsiMethod> classConstructors = PsiClassUtil.collectClassConstructorIntern(parentClass); return classConstructors.stream() .filter(m -> sameParameters(m.getParameterList().getParameters(), builderInfos)) .findFir...
getExistingConstructorForParameters
13,138
boolean (PsiParameter[] parameters, Collection<BuilderInfo> builderInfos) { if (parameters.length != builderInfos.size()) { return false; } final Iterator<BuilderInfo> builderInfoIterator = builderInfos.iterator(); for (PsiParameter psiParameter : parameters) { final BuilderInfo builderInfo = builderInfoIterator.next()...
sameParameters
13,139
String (@Nullable PsiMethod psiMethod, @NotNull PsiClass psiClass, @NotNull PsiType buildMethodReturnType, @NotNull String buildMethodPrepare, @NotNull String buildMethodParameters) { final String blockText; final String codeBlockFormat, callExpressionText; if (null == psiMethod || psiMethod.isConstructor()) { codeBloc...
createBuildMethodCodeBlockText
13,140
String (@NotNull PsiMethod psiMethod, @NotNull PsiClass builderClass) { final PsiClass containingClass = psiMethod.getContainingClass(); StringBuilder className = new StringBuilder(); if (null != containingClass) { className.append(containingClass.getName()).append("."); if (!psiMethod.isConstructor() && !psiMethod.has...
calculateCallExpressionForMethod
13,141
NoArgsConstructorProcessor () { return LombokProcessorManager.getInstance().getNoArgsConstructorProcessor(); }
getNoArgsConstructorProcessor
13,142
ToStringProcessor () { return LombokProcessorManager.getInstance().getToStringProcessor(); }
getToStringProcessor
13,143
Collection<PsiField> (@NotNull BuilderInfo info) { final PsiType builderFieldKeyType = getBuilderFieldType(info.getFieldType(), info.getProject()); return Collections.singleton( new LombokLightFieldBuilder(info.getManager(), info.getFieldName(), builderFieldKeyType) .withContainingClass(info.getBuilderClass()) .withMod...
renderBuilderFields
13,144
PsiType (@NotNull PsiType psiFieldType, @NotNull Project project) { final PsiManager psiManager = PsiManager.getInstance(project); final PsiType rowKeyType = PsiTypeUtil.extractOneElementType(psiFieldType, psiManager, COM_GOOGLE_COMMON_COLLECT_TABLE, 0); final PsiType columnKeyType = PsiTypeUtil.extractOneElementType(p...
getBuilderFieldType
13,145
void (@NotNull LombokLightMethodBuilder methodBuilder, @NotNull PsiType psiFieldType, @NotNull String singularName) { final PsiManager psiManager = methodBuilder.getManager(); final PsiType rowKeyType = PsiTypeUtil.extractOneElementType(psiFieldType, psiManager, COM_GOOGLE_COMMON_COLLECT_TABLE, 0); final PsiType column...
addOneMethodParameter
13,146
void (@NotNull LombokLightMethodBuilder methodBuilder, @NotNull PsiType psiFieldType, @NotNull String singularName) { final PsiManager psiManager = methodBuilder.getManager(); final PsiType rowKeyType = PsiTypeUtil.extractAllElementType(psiFieldType, psiManager, COM_GOOGLE_COMMON_COLLECT_TABLE, 0); final PsiType column...
addAllMethodParameter
13,147
String (@NotNull BuilderInfo info) { final String codeBlockFormat = "this.{0} = null;\n" + "return {1};"; return MessageFormat.format(codeBlockFormat, info.getFieldName(), info.getBuilderChainResult()); }
getClearMethodBody
13,148
String (@NotNull String singularName, @NotNull BuilderInfo info) { final String codeBlockTemplate = "if (this.{0} == null) this.{0} = {2}.{3}; \n" + "this.{0}.put(" + LOMBOK_ROW_KEY + ", " + LOMBOK_COLUMN_KEY + ", " + LOMBOK_VALUE + ");\n" + "return {4};"; return MessageFormat.format(codeBlockTemplate, info.getFieldNam...
getOneMethodBody
13,149
String (@NotNull String singularName, @NotNull BuilderInfo info) { final String codeBlockTemplate = """ if({0}==null)'{'throw new NullPointerException("{0} cannot be null");'}' if (this.{0} == null) this.{0} = {1}.{2};\s this.{0}.putAll({0}); return {3};"""; return MessageFormat.format(codeBlockTemplate, singularName, ...
getAllMethodBody
13,150
String (@NotNull PsiVariable psiVariable, @NotNull String fieldName, @NotNull String builderVariable) { final PsiManager psiManager = psiVariable.getManager(); final PsiType psiFieldType = psiVariable.getType(); final PsiType rowKeyType = PsiTypeUtil.extractOneElementType(psiFieldType, psiManager, COM_GOOGLE_COMMON_COL...
renderBuildCode
13,151
String (@NotNull BuilderInfo info) { return collectionQualifiedName + '.' + "builder()"; }
getEmptyCollectionCall
13,152
void (@NotNull LombokLightMethodBuilder methodBuilder, @NotNull PsiType psiFieldType, @NotNull String singularName) { final PsiType oneElementType = PsiTypeUtil.extractOneElementType(psiFieldType, methodBuilder.getManager()); methodBuilder.withParameter(singularName, oneElementType); }
addOneMethodParameter
13,153
void (@NotNull LombokLightMethodBuilder methodBuilder, @NotNull PsiType psiFieldType, @NotNull String singularName) { final PsiManager psiManager = methodBuilder.getManager(); final PsiType elementType = PsiTypeUtil.extractAllElementType(psiFieldType, psiManager); final PsiType collectionType = PsiTypeUtil.createCollec...
addAllMethodParameter
13,154
String (@NotNull BuilderInfo info) { final String codeBlockFormat = """ if (this.{0} != null)\s this.{0}.clear(); return {1};"""; return MessageFormat.format(codeBlockFormat, info.getFieldName(), info.getBuilderChainResult()); }
getClearMethodBody
13,155
String (@NotNull String singularName, @NotNull BuilderInfo info) { final String codeBlockTemplate = """ if (this.{0} == null) this.{0} = new java.util.ArrayList<{3}>();\s this.{0}.add({1}); return {2};"""; final PsiType oneElementType = PsiTypeUtil.extractOneElementType(info.getFieldType(), info.getManager()); return M...
getOneMethodBody
13,156
String (@NotNull String singularName, @NotNull BuilderInfo info) { final String codeBlockTemplate = """ if({0}==null)'{'throw new NullPointerException("{0} cannot be null");'}' if (this.{0} == null) this.{0} = new java.util.ArrayList<{2}>();\s this.{0}.addAll({0}); return {1};"""; final PsiType oneElementType = PsiType...
getAllMethodBody
13,157
String (@NotNull BuilderInfo info) { return renderBuildCode(info.getVariable(), info.getFieldName(), "this"); }
renderBuildPrepare
13,158
String (@NotNull BuilderInfo info) { return info.renderFieldName(); }
renderBuildCall
13,159
String (@NotNull PsiVariable psiVariable, @NotNull String fieldName) { return renderBuildCode(psiVariable, fieldName, "b") + "this." + psiVariable.getName() + "=" + fieldName + ";\n"; }
renderSuperBuilderConstruction
13,160
String (@NotNull BuilderInfo info) { final PsiType elementType = PsiTypeUtil.extractOneElementType(info.getVariable().getType(), info.getManager()); final String typeName = elementType.getCanonicalText(false); if (ContainerUtil.exists(SingularCollectionClassNames.JAVA_SETS, collectionQualifiedName::equals)) { return "j...
getEmptyCollectionCall
13,161
Collection<PsiField> (@NotNull BuilderInfo info) { final PsiType builderFieldKeyType = getBuilderFieldType(info.getFieldType(), info.getProject()); return Collections.singleton( new LombokLightFieldBuilder(info.getManager(), info.getFieldName(), builderFieldKeyType) .withContainingClass(info.getBuilderClass()) .withMod...
renderBuilderFields
13,162
PsiType (@NotNull PsiType psiFieldType, @NotNull Project project) { final PsiManager psiManager = PsiManager.getInstance(project); final PsiType keyType = PsiTypeUtil.extractOneElementType(psiFieldType, psiManager, CommonClassNames.JAVA_UTIL_MAP, 0); final PsiType valueType = PsiTypeUtil.extractOneElementType(psiFieldT...
getBuilderFieldType
13,163
void (@NotNull LombokLightMethodBuilder methodBuilder, @NotNull PsiType psiFieldType, @NotNull String singularName) { final PsiManager psiManager = methodBuilder.getManager(); final PsiType keyType = PsiTypeUtil.extractOneElementType(psiFieldType, psiManager, CommonClassNames.JAVA_UTIL_MAP, 0); final PsiType valueType ...
addOneMethodParameter
13,164
String (@NotNull BuilderInfo info) { final String codeBlockFormat = "this.{0} = null;\n" + "return {1};"; return MessageFormat.format(codeBlockFormat, info.getFieldName(), info.getBuilderChainResult()); }
getClearMethodBody
13,165
String (@NotNull String singularName, @NotNull BuilderInfo info) { final String codeBlockTemplate = "if (this.{0} == null) this.{0} = {2}.{3}; \n" + "this.{0}.put(" + LOMBOK_KEY + ", " + LOMBOK_VALUE + ");\n" + "return {4};"; return MessageFormat.format(codeBlockTemplate, info.getFieldName(), singularName, collectionQu...
getOneMethodBody
13,166
String (@NotNull String singularName, @NotNull BuilderInfo info) { final String codeBlockTemplate = """ if({0}==null)'{'throw new NullPointerException("{0} cannot be null");'}' if (this.{0} == null) this.{0} = {1}.{2};\s this.{0}.putAll({0}); return {3};"""; return MessageFormat.format(codeBlockTemplate, singularName, ...
getAllMethodBody
13,167
String (@NotNull PsiVariable psiVariable, @NotNull String fieldName, @NotNull String builderVariable) { final PsiManager psiManager = psiVariable.getManager(); final PsiType psiFieldType = psiVariable.getType(); final PsiType keyType = PsiTypeUtil.extractOneElementType(psiFieldType, psiManager, CommonClassNames.JAVA_UT...
renderBuildCode
13,168
String (@NotNull BuilderInfo info) { return collectionQualifiedName + '.' + "builder()"; }
getEmptyCollectionCall
13,169
boolean (@Nullable String qualifiedName) { return qualifiedName == null || !containsOrAnyEndsWith(VALID_SINGULAR_TYPES, qualifiedName); }
isInvalidSingularType
13,170
boolean (@NotNull Set<String> elements, @NotNull String className) { return elements.contains(className) || ContainerUtil.exists(elements, t -> t.endsWith("." + className)); }
containsOrAnyEndsWith
13,171
BuilderElementHandler (@NotNull PsiVariable psiVariable, boolean hasSingularAnnotation) { if (!hasSingularAnnotation) { return new NonSingularHandler(); } final PsiType psiType = psiVariable.getType(); final String qualifiedName = PsiTypeUtil.getQualifiedName(psiType); if (!isInvalidSingularType(qualifiedName)) { if (c...
getHandlerFor
13,172
Collection<PsiField> (@NotNull BuilderInfo info) { return Collections.emptyList(); }
renderBuilderFields
13,173
Collection<PsiMethod> (@NotNull BuilderInfo info) { return Collections.emptyList(); }
renderBuilderMethod
13,174
String (@NotNull BuilderInfo info) { return ""; }
calcBuilderMethodName
13,175
List<String> (@NotNull String fieldName, @NotNull String prefix, @Nullable PsiAnnotation singularAnnotation, CapitalizationStrategy capitalizationStrategy) { return Collections.emptyList(); }
getBuilderMethodNames
13,176
String (PsiAnnotation singularAnnotation, String psiFieldName) { return psiFieldName; }
createSingularName
13,177
Collection<PsiField> (@NotNull BuilderInfo info) { final PsiType builderFieldType = getBuilderFieldType(info.getFieldType(), info.getProject()); return Collections.singleton( new LombokLightFieldBuilder(info.getManager(), info.getFieldName(), builderFieldType) .withContainingClass(info.getBuilderClass()) .withModifier(...
renderBuilderFields
13,178
PsiType (@NotNull PsiType psiFieldType, @NotNull Project project) { final PsiManager psiManager = PsiManager.getInstance(project); final PsiType elementType = PsiTypeUtil.extractOneElementType(psiFieldType, psiManager); return PsiTypeUtil.createCollectionType(psiManager, CommonClassNames.JAVA_UTIL_ARRAY_LIST, elementTy...
getBuilderFieldType
13,179
Collection<PsiMethod> (@NotNull BuilderInfo info) { List<PsiMethod> methods = new ArrayList<>(); final PsiType returnType = info.getBuilderType(); final String fieldName = info.getFieldName(); final String singularName = createSingularName(info.getSingularAnnotation(), fieldName); final PsiClass builderClass = info.get...
renderBuilderMethod
13,180
String (String fieldName, CapitalizationStrategy capitalizationStrategy) { return LombokUtils.buildAccessorName("clear", fieldName, capitalizationStrategy); }
createSingularClearMethodName
13,181
List<String> (@NotNull String fieldName, @NotNull String prefix, @Nullable PsiAnnotation singularAnnotation, CapitalizationStrategy capitalizationStrategy) { final String accessorName = LombokUtils.buildAccessorName(prefix, fieldName, capitalizationStrategy); return Arrays.asList(createSingularName(singularAnnotation, ...
getBuilderMethodNames
13,182
String (@NotNull BuilderInfo info) { final String instanceGetter = info.getInstanceVariableName() + '.' + info.getVariable().getName(); return info.getFieldName() + '(' + instanceGetter + " == null ? " + getEmptyCollectionCall(info) + " : " + instanceGetter + ')'; }
renderToBuilderCall
13,183
String (@NotNull BuilderInfo info) { final String instanceGetter = info.getInstanceVariableName() + '.' + info.getVariable().getName(); return "if(" + instanceGetter + " != null) "+BUILDER_TEMP_VAR +"."+info.getFieldName() +'('+ instanceGetter + ");"; }
renderToBuilderAppendCall
13,184
String (@NotNull PsiAnnotation singularAnnotation, String psiFieldName) { String singularName = PsiAnnotationUtil.getStringAnnotationValue(singularAnnotation, "value", ""); if (StringUtil.isEmptyOrSpaces(singularName)) { singularName = Singulars.autoSingularize(psiFieldName); if (singularName == null) { singularName = ...
createSingularName
13,185
boolean (PsiAnnotation singularAnnotation, String psiFieldName) { String singularName = PsiAnnotationUtil.getStringAnnotationValue(singularAnnotation, "value", ""); if (StringUtil.isEmptyOrSpaces(singularName)) { singularName = Singulars.autoSingularize(psiFieldName); return singularName != null; } return true; }
validateSingularName
13,186
PsiType (PsiManager psiManager, PsiType psiFieldType) { return PsiTypeUtil.extractOneElementType(psiFieldType, psiManager, CommonClassNames.JAVA_UTIL_MAP, 0); }
getKeyType
13,187
PsiType (PsiManager psiManager, PsiType psiFieldType) { return PsiTypeUtil.extractOneElementType(psiFieldType, psiManager, CommonClassNames.JAVA_UTIL_MAP, 1); }
getValueType
13,188
Collection<PsiField> (@NotNull BuilderInfo info) { final PsiType keyType = getKeyType(info.getManager(), info.getFieldType()); final PsiType builderFieldKeyType = getBuilderFieldType(keyType, info.getProject()); final PsiType valueType = getValueType(info.getManager(), info.getFieldType()); final PsiType builderFieldVa...
renderBuilderFields
13,189
PsiType (@NotNull PsiType psiType, @NotNull Project project) { final PsiManager psiManager = PsiManager.getInstance(project); return PsiTypeUtil.createCollectionType(psiManager, CommonClassNames.JAVA_UTIL_ARRAY_LIST, psiType); }
getBuilderFieldType
13,190
void (@NotNull LombokLightMethodBuilder methodBuilder, @NotNull PsiType psiFieldType, @NotNull String singularName) { final PsiManager psiManager = methodBuilder.getManager(); final PsiType keyType = getKeyType(psiManager, psiFieldType); final PsiType valueType = getValueType(psiManager, psiFieldType); methodBuilder.wi...
addOneMethodParameter
13,191
void (@NotNull LombokLightMethodBuilder methodBuilder, @NotNull PsiType psiFieldType, @NotNull String singularName) { final PsiManager psiManager = methodBuilder.getManager(); final PsiType keyType = PsiTypeUtil.extractAllElementType(psiFieldType, psiManager, CommonClassNames.JAVA_UTIL_MAP, 0); final PsiType valueType ...
addAllMethodParameter
13,192
String (@NotNull BuilderInfo info) { final String codeBlockFormat = "if (this.{0}" + LOMBOK_KEY + " != null) '{'\n this.{0}" + LOMBOK_KEY + ".clear();\n " + " this.{0}" + LOMBOK_VALUE + ".clear(); '}'\n" + "return {1};"; return MessageFormat.format(codeBlockFormat, info.getFieldName(), info.getBuilderChainResult()); }
getClearMethodBody
13,193
String (@NotNull String singularName, @NotNull BuilderInfo info) { final String codeBlockTemplate = "if (this.{0}" + LOMBOK_KEY + " == null) '{' \n" + "this.{0}" + LOMBOK_KEY + " = new java.util.ArrayList<{3}>(); \n" + "this.{0}" + LOMBOK_VALUE + " = new java.util.ArrayList<{4}>(); \n" + "'}' \n" + "this.{0}" + LOMBOK_...
getOneMethodBody
13,194
String (@NotNull String singularName, @NotNull BuilderInfo info) { final String codeBlockTemplate = "if({0}==null)'{'throw new NullPointerException(\"{0} cannot be null\");'}'\n" + "if (this.{0}" + LOMBOK_KEY + " == null) '{' \n" + "this.{0}" + LOMBOK_KEY + " = new java.util.ArrayList<{2}>(); \n" + "this.{0}" + LOMBOK_...
getAllMethodBody
13,195
String (@NotNull BuilderInfo info) { return renderBuildCode(info.getVariable(), info.getFieldName(), "this"); }
renderBuildPrepare
13,196
String (@NotNull BuilderInfo info) { return info.renderFieldName(); }
renderBuildCall
13,197
String (@NotNull PsiVariable psiVariable, @NotNull String fieldName) { final String basicCode = renderBuildCode(psiVariable, fieldName, "b"); final String assignment = "this." + psiVariable.getName() + "=" + fieldName + ";\n"; return basicCode + assignment; }
renderSuperBuilderConstruction
13,198
String (@NotNull BuilderInfo info) { final PsiManager psiManager = info.getManager(); final PsiType psiFieldType = info.getVariable().getType(); final PsiType keyType = getKeyType(psiManager, psiFieldType); final PsiType valueType = getValueType(psiManager, psiFieldType); final String keyTypeName = keyType.getCanonical...
getEmptyCollectionCall
13,199
PsiType (@NotNull PsiType psiFieldType, @NotNull Project project) { final PsiManager psiManager = PsiManager.getInstance(project); final PsiType elementType = PsiTypeUtil.extractOneElementType(psiFieldType, psiManager); return PsiTypeUtil.createCollectionType(psiManager, typeCollectionQualifiedName + ".Builder", elemen...
getBuilderFieldType