Class GuiceInteractionControllerInstantiator
java.lang.Object
com.github.kaktushose.jda.commands.guice.internal.GuiceInteractionControllerInstantiator
- All Implemented Interfaces:
InteractionControllerInstantiator,Implementation.ExtensionProvidable
@Internal
public class GuiceInteractionControllerInstantiator
extends Object
implements InteractionControllerInstantiator
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.kaktushose.jda.commands.dispatching.instance.InteractionControllerInstantiator
InteractionControllerInstantiator.Context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionforRuntime(String id, JDA jda) Creates a new child injector with its ownInteractionControllerInstantiatorModulefor each runtime.<T> Tinstance(Class<T> clazz, InteractionControllerInstantiator.Context context) This method will be called each time an instance of a class annotated withInteractionis needed.
-
Constructor Details
-
GuiceInteractionControllerInstantiator
-
-
Method Details
-
instance
Description copied from interface:InteractionControllerInstantiatorThis method will be called each time an instance of a class annotated withInteractionis needed.- Specified by:
instancein interfaceInteractionControllerInstantiator- Parameters:
clazz- theClassof needed instancecontext- a context that gives additional useful information or provide some needed functionality
-
forRuntime
Creates a new child injector with its ownInteractionControllerInstantiatorModulefor each runtime. This has the effect, that each class annotated withInteractionwill be treated as a runtime scoped singleton.- Specified by:
forRuntimein interfaceInteractionControllerInstantiator- Parameters:
id- the runtime idjda- theJDAinstance associated with the event responsible for creating the new Runtime instance- Returns:
- a specific instance of
InteractionControllerInstantiatorbelonging to provided runtime.
-