Repository navigation
add public/internal/spi annotations - #411
Conversation
|
Naming is hard. I would use @internal rather than @internalapi Also I think we should consider @experimentalapi and ExperimentalSpi. This allows you to stage new code without the super strong commitment. |
| import static java.lang.annotation.ElementType.METHOD; | ||
| import static java.lang.annotation.ElementType.TYPE; | ||
|
|
||
| @Retention(RetentionPolicy.RUNTIME) |
There was a problem hiding this comment.
| import static java.lang.annotation.ElementType.CONSTRUCTOR; | ||
| import static java.lang.annotation.ElementType.METHOD; | ||
| import static java.lang.annotation.ElementType.TYPE; | ||
|
|
| @InternalApi | ||
| public GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy, ExecutionStrategy mutationStrategy, ExecutionStrategy subscriptionStrategy) { | ||
| this(graphQLSchema, queryStrategy, mutationStrategy, subscriptionStrategy, DEFAULT_EXECUTION_ID_PROVIDER, NoOpInstrumentation.INSTANCE); | ||
| } |
There was a problem hiding this comment.
In 4.0 we should remove deprecations.
5aa6abc to
9b10764
Compare
9b10764 to
e700c9c
Compare
|
@bbakerman Changed it to I am not really sure about the "rules" where to put these annotations: I added the on the class/interface, but not on every method. I quietly assume that every method is public or internal if the type itself is so. If this is not the case I added a extra annotation: for example the constructor is marked as |
|
Yeah I think you put them on the class and then IF you want to make an exemption, you put that into the method. The typical ones will be constructors. By making them @internal you allow them to be expanded over time without breaking API. The builders are how people should construct them and hence we can default values there etc.. |
|
It is a first start: we will add new annotations before 3.0.0 |
This is a first idea how we could handle #284:
There are three different Annotations:
-
@PublicApifor public classes/methods/interfaces.@PrivateApifor private stuff@PublicSpifor public interfaces/abstract classes which users are expected to implement.