From 50b83f703589c5fb42b3b86434dfc7434c3e9f30 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 13 Dec 2022 17:14:08 -0700 Subject: [PATCH 1/2] Improve doc on ParameterInjectorRegistry#registerInjector --- .../annotations/injection/ParameterInjectorRegistry.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cloud-core/src/main/java/cloud/commandframework/annotations/injection/ParameterInjectorRegistry.java b/cloud-core/src/main/java/cloud/commandframework/annotations/injection/ParameterInjectorRegistry.java index 55c1ad628..b6e56e62c 100644 --- a/cloud-core/src/main/java/cloud/commandframework/annotations/injection/ParameterInjectorRegistry.java +++ b/cloud-core/src/main/java/cloud/commandframework/annotations/injection/ParameterInjectorRegistry.java @@ -80,7 +80,11 @@ public synchronized void registerInjector( } /** - * Register an injector for a particular type predicate. + * Register an injector for a particular type predicate. The predicate should only + * return true if the injected type is assignable to the tested type. This predicate overload + * is provided in addition to {@link #registerInjector(Class, ParameterInjector)} to allow + * for exact, non-exact, or custom predicates, however is still bound by the aforementioned constraint. + * Failure to adhere to this will result in runtime exceptions. * * @param predicate A predicate that matches if the injector should be used for a type * @param injector The injector that should inject the value into the command method From a70a097dbcd22e448f9ebe08773dbdbdc8e8a153 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Thu, 15 Dec 2022 13:19:41 -0700 Subject: [PATCH 2/2] review --- .../annotations/injection/ParameterInjectorRegistry.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cloud-core/src/main/java/cloud/commandframework/annotations/injection/ParameterInjectorRegistry.java b/cloud-core/src/main/java/cloud/commandframework/annotations/injection/ParameterInjectorRegistry.java index b6e56e62c..ba6db9d94 100644 --- a/cloud-core/src/main/java/cloud/commandframework/annotations/injection/ParameterInjectorRegistry.java +++ b/cloud-core/src/main/java/cloud/commandframework/annotations/injection/ParameterInjectorRegistry.java @@ -80,11 +80,13 @@ public synchronized void registerInjector( } /** - * Register an injector for a particular type predicate. The predicate should only + * Register an injector for a particular type predicate. + * + *

The predicate should only * return true if the injected type is assignable to the tested type. This predicate overload * is provided in addition to {@link #registerInjector(Class, ParameterInjector)} to allow * for exact, non-exact, or custom predicates, however is still bound by the aforementioned constraint. - * Failure to adhere to this will result in runtime exceptions. + * Failure to adhere to this will result in runtime exceptions.

* * @param predicate A predicate that matches if the injector should be used for a type * @param injector The injector that should inject the value into the command method