Package org.panda_lang.utilities.inject
Interface Bind<A extends Annotation>
- All Superinterfaces:
Comparable<Bind<A>>
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignHandler(TriFunction<Property, A, Object[], ?> handler) Assign custom handler to the bindvoidassignInstance(Object value) Assign an object to the bindvoidassignInstance(Supplier<?> valueSupplier) Assign value supplier to the bindvoidassignThrowingHandler(ThrowingTriFunction<Property, A, Object[], ?, ? extends Exception> handler) Assign custom handler to the bind which can throw an exceptionvoidassignThrowingInstance(ThrowingSupplier<?, ? extends Exception> valueSupplier) Assign value supplier to the bind which can throw an exceptiondefault intClass<?>Get an associated type with the bindClass<?>Get a data typeGet the value of bind for the required (parameter) type and instance of a bind type
-
Method Details
-
assignInstance
Assign an object to the bind- Parameters:
value- the instance to assign
-
assignInstance
Assign value supplier to the bind- Parameters:
valueSupplier- the supplier to assign
-
assignThrowingInstance
Assign value supplier to the bind which can throw an exception- 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
-
assignThrowingHandler
Assign custom handler to the bind which can throw an exception- Parameters:
handler- the handler which accepts type of parameter and bind type as arguments
-
getValue
Get the value of bind for the required (parameter) type and instance of a bind type- Parameters:
required- the required return typeannotation- instance of bind generic typeinjectorArgs- custom arguments for injector, used by custom handlers- Returns:
- the result value
- Throws:
Exception- if anything wrong during obtaining value
-
getAssociatedType
Class<?> getAssociatedType()Get an associated type with the bind- Returns:
- the associated type
-
getDataType
Class<?> getDataType()Get a data type- Returns:
- the data type
-
compareTo
- Specified by:
compareToin interfaceComparable<A extends Annotation>
-