Package org.panda_lang.utilities.inject
Interface Bind<A extends Annotation>
- All Superinterfaces:
Comparable<Bind<A>>
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignHandler(panda.std.function.TriFunction<Property, A, Object[], ?> handler) Assign custom handler to the bindvoidassignInstance(Object value) Assign object to the bindvoidassignInstance(Supplier<?> valueSupplier) Assign value supplier to the binddefault intClass<?>Get associated type with the bindClass<?>Get data typeGet value of bind for the required (parameter) type and instance of bind type
-
Method Details
-
assignInstance
Assign object to the bind- Parameters:
value- the instance to assign
-
assignInstance
Assign value supplier to the bind- Parameters:
valueSupplier- the supplier to assign
-
assignHandler
Assign custom handler to the bind- Parameters:
handler- the handler which accepts type of parameter and bind type as arguments
-
getValue
Get value of bind for the required (parameter) type and instance of bind type- Parameters:
required- the required return typeannotation- instance of bind generic typeinjectorArgs- custom arguments for injector- Returns:
- the result value
- Throws:
Exception- if anything wrong will happen, whole process should be stopped
-
getAssociatedType
Class<?> getAssociatedType()Get associated type with the bind- Returns:
- the associated type
-
getDataType
Class<?> getDataType()Get data type- Returns:
- the data type
-
compareTo
- Specified by:
compareToin interfaceComparable<A extends Annotation>
-