Interface Instantiator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An Instantiator is used get instances of classes, if needed creating those.
For classes annotated with Interaction, there can be only one instance per class of those per
Runtime. Instances of interactions should be treated like
runtime scoped singletons, so to speak.
-
Method Summary
Modifier and TypeMethodDescription<T> Tinstance(Class<T> clazz, JDACIntrospection introspection) This method will be called each time an instance of a class is needed.
-
Method Details
-
instance
This method will be called each time an instance of a class is needed.
The provided
JDACIntrospectioninstance orJDACIntrospection.accessScoped()can be used to retrieve other components/parts of this framework, e.g.MessageResolver.- Parameters:
clazz- theClassof needed instanceintrospection- theJDACIntrospectioninstance of this runtime (scope =JDACScope.RUNTIME).
-