You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, when using autopipeline, I encountered a little difficulty about using annotation.
The annotations in my interface like @NotNull cannot be retained in the generated classes (including the implementations of my interface and the Handler interface), which makes it impossible for me to constrain the Handler implementations at the interface level.
code sample:
@AutoPipelinepublicinterfaceConfigSource {
@NotNullStringget(@NotNullStringkey);
}
// I hope the implementations of ConfigSourceHandler can also be constrained by @NotNull.publicclassConfigSourceHandlerImplimplementsConfigSourceHandler {
@OverridepublicStringget(Stringkey, ConfigSourceHandlerContextconfigSourceHandlerContext) {
returnnull;
}
}
The text was updated successfully, but these errors were encountered:
In my opinion, the issue actually suggests AutoPipeline to take the annotations from the interface ( which may present on the interface, method, or parameter) to the generated classes, I think there are some corner cases we need to think about.
e.g. obviously, we need to ignore the @AutoPipeline / @PipelineDirection , and also, we need to ignore the @FunctionalInterface because class have the @FunctionalInterface annotation will cause some compile error, and so is the @SuppressWarnings annotations...
We can't find out all the cases that we need to ignore, we can't exhaust all bad cases.
Maybe we need to add some configuration to let user specify which annotation will take to the pipeline class, but it will increase the complexity of the library.
and, from another perspective, we need to ensure the correct of the generated classes, and we indeed need a solution to the @NotNull / @NonNull case.
So, I think the solution is to add another annotation to specify which annotation will be used in the generated classes,
it may increase some complexity, and we need to try to keep simple to the users as far as possible.
Hi, when using autopipeline, I encountered a little difficulty about using annotation.
The annotations in my interface like @NotNull cannot be retained in the generated classes (including the implementations of my interface and the Handler interface), which makes it impossible for me to constrain the Handler implementations at the interface level.
code sample:
The text was updated successfully, but these errors were encountered: