public interface InjectorResourceBind<A extends Annotation> extends Comparable<InjectorResourceBind<A>>
| Modifier and Type | Method and Description |
|---|---|
void |
assign(Class<?> type)
Assign class to the bind (a new instance will be created each time)
|
void |
assignHandler(org.panda_lang.utilities.commons.function.TriFunction<InjectorProperty,A,Object[],?> handler)
Assign custom handler to the bind
|
void |
assignInstance(Object value)
Assign object to the bind
|
void |
assignInstance(Supplier<?> valueSupplier)
Assign value supplier to the bind
|
default int |
compareTo(@NotNull InjectorResourceBind bind) |
Class<?> |
getAssociatedType()
Get associated type with the bind
|
Class<?> |
getDataType()
Get data type
|
Object |
getValue(InjectorProperty required,
A annotation,
Object... injectorArgs)
Get value of bind for the required (parameter) type and instance of bind type
|
void assign(Class<?> type)
type - the type of value to assignvoid assignInstance(Object value)
value - the instance to assignvoid assignInstance(Supplier<?> valueSupplier)
valueSupplier - the supplier to assignvoid assignHandler(org.panda_lang.utilities.commons.function.TriFunction<InjectorProperty,A,Object[],?> handler)
handler - the handler which accepts type of parameter and bind type as argumentsObject getValue(InjectorProperty required, A annotation, Object... injectorArgs) throws Exception
required - the required return typeannotation - instance of bind generic typeinjectorArgs - custom arguments for injectorException - if anything wrong will happen, whole process should be stoppedClass<?> getAssociatedType()
Class<?> getDataType()
default int compareTo(@NotNull
@NotNull InjectorResourceBind bind)
compareTo in interface Comparable<InjectorResourceBind<A extends Annotation>>Copyright © 2021. All rights reserved.