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 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
    • assignHandler

      void assignHandler(panda.std.function.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
    • getValue

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

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