Module dagger

Class DelegateFactory<T>

  • All Implemented Interfaces:
    Factory<T>, jakarta.inject.Provider<T>

    public final class DelegateFactory<T>
    extends java.lang.Object
    implements Factory<T>
    A DelegateFactory that is used to stitch Provider/Lazy indirection based dependency cycles.
    Since:
    2.0.1
    • Constructor Summary

      Constructors 
      Constructor Description
      DelegateFactory()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()  
      static <T> void setDelegate​(jakarta.inject.Provider<T> delegateFactory, jakarta.inject.Provider<T> delegate)
      Sets delegateFactory's delegate provider to delegate.
      • Methods inherited from class java.lang.Object

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

      • DelegateFactory

        public DelegateFactory()
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface jakarta.inject.Provider<T>
      • setDelegate

        public static <T> void setDelegate​(jakarta.inject.Provider<T> delegateFactory,
                                           jakarta.inject.Provider<T> delegate)
        Sets delegateFactory's delegate provider to delegate.

        delegateFactory must be an instance of DelegateFactory, otherwise this method will throw a ClassCastException.