Interface Bind<A extends Annotation>

All Superinterfaces:
Comparable<Bind<A>>

public interface Bind<A extends Annotation> extends Comparable<Bind<A>>
  • Method Details

    • assignInstance

      void assignInstance(Object value)
      Assign an object to the bind
      Parameters:
      value - the instance to assign
    • assignInstance

      void assignInstance(Supplier<?> valueSupplier)
      Assign value supplier to the bind
      Parameters:
      valueSupplier - the supplier to assign
    • assignThrowingInstance

      void assignThrowingInstance(ThrowingSupplier<?,? extends Exception> valueSupplier)
      Assign value supplier to the bind which can throw an exception
      Parameters:
      valueSupplier - the supplier to assign
    • assignHandler

      void assignHandler(TriFunction<Property,A,Object[],?> handler)
      Assign custom handler to the bind
      Parameters:
      handler - the handler which accepts type of parameter and bind type as arguments
    • assignThrowingHandler

      void assignThrowingHandler(ThrowingTriFunction<Property,A,Object[],?,? extends Exception> handler)
      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

      Object getValue(Property required, A annotation, Object... injectorArgs) throws Exception
      Get the value of bind for the required (parameter) type and instance of a bind type
      Parameters:
      required - the required return type
      annotation - instance of bind generic type
      injectorArgs - 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

      default int compareTo(@NotNull @NotNull Bind bind)
      Specified by:
      compareTo in interface Comparable<A extends Annotation>