Package dagger.hilt

Class EntryPoints


  • public final class EntryPoints
    extends java.lang.Object
    Static utility methods for accessing objects through entry points.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T get​(java.lang.Object component, java.lang.Class<T> entryPoint)
      Returns the entry point interface given a component or component manager.
      • Methods inherited from class java.lang.Object

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

      • get

        @Nonnull
        public static <T> T get​(java.lang.Object component,
                                java.lang.Class<T> entryPoint)
        Returns the entry point interface given a component or component manager. Note that this performs an unsafe cast and so callers should be sure that the given component/component manager matches the entry point interface that is given.
        Parameters:
        component - The Hilt-generated component instance. For convenience, also takes component manager instances as well.
        entryPoint - The interface marked with EntryPoint. The InstallIn annotation on this entry point should match the component argument above.