Package org.incendo.cloud.injection
Class GuiceInjectionService<C>
java.lang.Object
org.incendo.cloud.injection.GuiceInjectionService<C>
- Type Parameters:
C- command sender type
- All Implemented Interfaces:
Function<InjectionRequest<C>,,Object> InjectionService<C>,Service<InjectionRequest<C>,Object>
@API(status=STABLE)
public final class GuiceInjectionService<C>
extends Object
implements InjectionService<C>
Injection service that injects using a Guice Injector
You should not put Inject annotation on your methods.
Ignore the warning says 'Binding annotation @YourAnnotation without @Inject declared'.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull GuiceInjectionService<C> Creates a new Guice injection service that wraps the given injectorhandle(@NonNull InjectionRequest<C> request)
-
Method Details
-
create
public static <C> @NonNull GuiceInjectionService<C> create(@NonNull com.google.inject.Injector injector) Creates a new Guice injection service that wraps the given injector- Type Parameters:
C- command sender type- Parameters:
injector- injector to wrap- Returns:
- the created injection service
-
handle
- Specified by:
handlein interfaceService<InjectionRequest<C>,Object>
-