public interface IScellApiResolver
Aimed to resolve or replace the required instances of the API
Can be obtained by the following call: ScellApiEntryPoint.getApiResolverAsync()
Modifier and Type | Method and Description |
---|---|
<TInstance> |
registerImplementation(Class<TInstance> interfaceClass,
Class<? extends TInstance> implementation)
Binds the given class to the given interface.
|
<TInstance> |
registerInstance(Class<TInstance> interfaceClass,
TInstance instance)
Binds an instance of the class to the given interface.
|
<TInstance> |
resolve(Class<TInstance> interfaceClass)
Resolves a new instance or a singleton instance of the given interface.
|
<TInstance> TInstance resolve(Class<TInstance> interfaceClass)
TInstance
- the type of the interface;interfaceClass
- the Class<TInstance> interface to be resolved;registerInstance(Class, Object)
,
registerImplementation(Class, Class)
<TInstance> void registerInstance(Class<TInstance> interfaceClass, TInstance instance)
The resolve(Class)
method will always return an instance of the class of the given interface.
TInstance
- the type of the interface.interfaceClass
- the interface to be bound;instance
- an instance of the class to be bound;<TInstance> void registerImplementation(Class<TInstance> interfaceClass, Class<? extends TInstance> implementation)
The resolve(Class)
method will always return the new instance
of the given class bound to the given interface.
TInstance
- type of the interface.interfaceClass
- interface to be bound;implementation
- class to be bound;Copyright © 2024. All rights reserved.