Class AbstractFactory<A,​B,​C,​D>

  • All Implemented Interfaces:
    Factory<C>
    Direct Known Subclasses:
    ConcreteFactory

    public abstract class AbstractFactory<A,​B,​C,​D>
    extends java.lang.Object
    implements Factory<C>
    This is an abstract factory, the true type will comd from the concrete class
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractFactory()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose​(C killMe)
      This method will dispose of objects created with this scope.
      abstract A getA()  
      abstract B getB()  
      abstract C getC()  
      abstract D getD()  
      C provide()
      This method will create instances of the type of this factory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractFactory

        public AbstractFactory()
    • Method Detail

      • getA

        public abstract A getA()
      • getB

        public abstract B getB()
      • getC

        public abstract C getC()
      • getD

        public abstract D getD()
      • provide

        @Singleton
        public C provide()
        Description copied from interface: Factory
        This method will create instances of the type of this factory. The provide method must be annotated with the desired scope and qualifiers.
        Specified by:
        provide in interface Factory<A>
        Returns:
        The produces object
      • dispose

        public void dispose​(C killMe)
        Description copied from interface: Factory
        This method will dispose of objects created with this scope. This method should not be annotated, as it is naturally paired with the provide method
        Specified by:
        dispose in interface Factory<A>
        Parameters:
        killMe - The instance to dispose of