Skip to content

Commit

Permalink
Added note on ServiceProviderBuildItem constructors to warn what they do
Browse files Browse the repository at this point in the history
  • Loading branch information
FroMage authored and Simulant87 committed Nov 23, 2019
1 parent a63699e commit c3833f3
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,26 @@ public final class ServiceProviderBuildItem extends MultiBuildItem {
private final String serviceInterface;
private final List<String> providers;

/**
* Registers the specified service interface descriptor to be embedded and allow reflection (instantiation only)
* of the specified provider classes. Note that the service interface descriptor file has to exist and match the
* list of specified provider class names.
*
* @param serviceInterfaceClassName the interface whose service interface descriptor file we want to embed
* @param providerClassNames the list of provider class names that must already be mentioned in the file
*/
public ServiceProviderBuildItem(String serviceInterfaceClassName, String... providerClassNames) {
this(serviceInterfaceClassName, Arrays.asList(providerClassNames));
}

/**
* Registers the specified service interface descriptor to be embedded and allow reflection (instantiation only)
* of the specified provider classes. Note that the service interface descriptor file has to exist and match the
* list of specified provider class names.
*
* @param serviceInterfaceClassName the interface whose service interface descriptor file we want to embed
* @param providers the list of provider class names that must already be mentioned in the file
*/
public ServiceProviderBuildItem(String serviceInterfaceClassName, List<String> providers) {
this.serviceInterface = Objects.requireNonNull(serviceInterfaceClassName, "The service interface must not be `null`");
this.providers = providers;
Expand Down

0 comments on commit c3833f3

Please sign in to comment.