public < T > T getModule ( final Class < T > interfaceImplemented , final String moduleType ) throws NullPointerException { //check for this type in the map Map < String , Object > computedValue = loadedModules . computeIfAbsent ( interfaceImplemented , ModuleProvider :: loadModules ) ; Object moduleInstance = computedValue . get ( moduleType ) ; Objects . requireNonNull ( moduleInstance , "Unable to find implementation of " + interfaceImplemented . getName ( ) + " with moduleType " + moduleType ) ; return ( T ) moduleInstance ; }
Retrieves a module by its simple name that implements a particular type T