Class GuiceExtension
java.lang.Object
com.github.kaktushose.jda.commands.guice.GuiceExtension
- All Implemented Interfaces:
Extension
The implementation of Extension
for using Google's Guice
as an InteractionControllerInstantiator
.
Additionally, this extension allows the automatic registration of some types annotated with @Implementation
.
For further information please see the docs on @Implementation
.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.kaktushose.jda.commands.extension.Extension
Extension.Data
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Class
<GuiceExtensionData> dataType()
void
init
(@Nullable Extension.Data data) Initialises theExtension
with the providedExtension.Data
.@NotNull Injector
injector()
@NotNull Collection
<Implementation<?>> Gets a collection ofImplementation
s thisExtension
provides.
-
Constructor Details
-
GuiceExtension
public GuiceExtension()
-
-
Method Details
-
init
Description copied from interface:Extension
Initialises theExtension
with the providedExtension.Data
. Will be called right after jda-commands loaded the Extension.- Specified by:
init
in interfaceExtension
- Parameters:
data
- The custom implementation ofExtension.Data
if given by the User. This can be safely cast to the type returned byExtension.dataType()
.
-
providedImplementations
Description copied from interface:Extension
Gets a collection ofImplementation
s thisExtension
provides.- Specified by:
providedImplementations
in interfaceExtension
- Returns:
- a collection of
Implementation
s
-
dataType
- Specified by:
dataType
in interfaceExtension
- Returns:
- the
Class
of the customExtension.Data
implementation
-
injector
-