Interface Constructable<T>

  • Type Parameters:
    T - the type of the instances produced
    All Known Subinterfaces:
    Injectable<T>
    All Known Implementing Classes:
    ClassObjectFactory, FieldObjectFactory, MethodObjectFactory

    public interface Constructable<T>
    Provides an object, potentially constructing it directly or indirectly and any other objects that it depends on.
    • Method Detail

      • create

        T create​(java.util.List<Injection> injections)
          throws org.int4.dirk.api.instantiation.CreationException
        Creates an instance.
        Parameters:
        injections - a list of Injection containing values to be injected, never null or contains nulls but can be empty
        Returns:
        an instance, or null if it could not be provided
        Throws:
        org.int4.dirk.api.instantiation.CreationException - when instantiation fails
      • destroy

        void destroy​(T instance)
        Destroys an instance.
        Parameters:
        instance - an instance to destroy, cannot be null