public interface InjectorResourceBind<T,V> extends Comparable<InjectorResourceBind<T,V>>
| 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(BiFunction<Parameter,V,?> 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(Parameter required,
V data)
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(BiFunction<Parameter,V,?> handler)
handler - the handler which accepts type of parameter and bind type as argumentsObject getValue(Parameter required, V data) throws Exception
required - the required return typedata - instance of bind generic typeException - 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<T,V>>Copyright © 2020. All rights reserved.