public synchronized static DataMapperLibrary get(String libraryName) { Optional<DataMapperLibrary> at = Optional.ofNullable(getLibraries().get(libraryName)); return at.orElseThrow( () -> new RuntimeException("DataMapperLibrary '" + libraryName + "' not found.") ); }
/** * Return list of libraries that have been found by this runtime, * in alphabetical order of their type names. * @return a list of DataMapperLibrary instances. */ public synchronized static List<DataMapperLibrary> getAll() { List<DataMapperLibrary> libraries = new ArrayList<>(getLibraries().values()); libraries.sort((o1, o2) -> o1.getLibraryName().compareTo(o2.getLibraryName())); return Collections.unmodifiableList(libraries); } }