Skip to content

Commit

Permalink
✨ Refactor Documentation to support multiple "since" values (from p…
Browse files Browse the repository at this point in the history
…re1 to release)

Updated the `Documentation` class to allow multiple "since" entries by changing its field type to an array. Adjusted related method signatures and annotations to accommodate this enhancement.
  • Loading branch information
ItsTheSky committed Jan 16, 2025
1 parent e0d232a commit 712b94d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public static class Documentation {
private final String name;
private final String[] description;
private final String[] examples;
private final String since;
private final String[] since;

public Documentation(String name, String description, String examples, String since) {
public Documentation(String name, String description, String examples, String... since) {
this.name = name;
this.description = description.split("\n");
this.examples = examples.split("\n");
Expand All @@ -85,7 +85,7 @@ public String[] getExamples() {
return examples;
}

public String getSince() {
public String[] getSince() {
return since;
}
}
Expand All @@ -106,7 +106,7 @@ public static <F, T> void register(String fromTypeName,
.annotateType(AnnotationDescription.Builder.ofType(Name.class).define("value", documentation.getName()).build())
.annotateType(AnnotationDescription.Builder.ofType(Description.class).defineArray("value", documentation.getDescription()).build())
.annotateType(AnnotationDescription.Builder.ofType(Examples.class).defineArray("value", documentation.getExamples()).build())
.annotateType(AnnotationDescription.Builder.ofType(Since.class).define("value", documentation.getSince()).build())
.annotateType(AnnotationDescription.Builder.ofType(Since.class).defineArray("value", documentation.getSince()).build())

.method(named("convert")).intercept(MethodDelegation.to(new ConvertMethodInterceptor<>(converter)))
.method(named("getPropertyName")).intercept(MethodDelegation.to(new PropertyNameMethodInterceptor(propertyName)))
Expand Down

0 comments on commit 712b94d

Please sign in to comment.