Skip to content

Commit

Permalink
make the NewConfig class and its methods public
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladicek committed Nov 28, 2024
1 parent 8ac5cc6 commit 820aa77
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ private void generateNewConfig(Set<TypeElement> configAnnotations) throws IOExce

JavaFile.builder(packageName, TypeSpec.classBuilder(mappingClassName)
.addJavadoc("Automatically generated from all config annotations, do not modify.")
.addModifiers(Modifier.FINAL)
.addModifiers(Modifier.PUBLIC, Modifier.FINAL)
.addField(FieldSpec.builder(TypeNames.HASHMAP_OF_STRING_TO_STRING, "MAP",
Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL)
.initializer("mapping()")
Expand All @@ -365,13 +365,13 @@ private void generateNewConfig(Set<TypeElement> configAnnotations) throws IOExce
.addCode(generateMappingTable(configAnnotations))
.build())
.addMethod(MethodSpec.methodBuilder("get")
.addModifiers(Modifier.STATIC)
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.returns(TypeNames.STRING)
.addParameter(TypeNames.CLASS_OF_ANNOTATION, "annotation")
.addStatement("return MAP.get(annotation.getSimpleName())")
.build())
.addMethod(MethodSpec.methodBuilder("get")
.addModifiers(Modifier.STATIC)
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.returns(TypeNames.STRING)
.addParameter(TypeNames.CLASS_OF_ANNOTATION, "annotation")
.addParameter(TypeNames.STRING, "member")
Expand Down

0 comments on commit 820aa77

Please sign in to comment.