Class DependencyProviderBase

    • Constructor Detail

      • DependencyProviderBase

        public DependencyProviderBase()
    • Method Detail

      • getDependency

        public <T> T getDependency​(Class<T> clazz)
                            throws ClassNotFoundException
        Retrieve the dependency of type T.
        Specified by:
        getDependency in interface DependencyProvider
        Type Parameters:
        T - The type of the dependency class.
        Parameters:
        clazz - the dependency's class
        Returns:
        the dependency
        Throws:
        ClassNotFoundException - if provider does not have a class registered for the requested class type
      • register

        public <T> T register​(Class<T> clazz,
                              T obj)
        Register a new provided dependency.
        Type Parameters:
        T - The type of the dependency.
        Parameters:
        clazz - the class to register
        obj - the instance to provide
        Returns:
        the previous values registered for clazz