@Test public void factoryForName() { assertThat(SecurityAnalysisPreprocessors.factoryForName("test")) .isInstanceOf(TestPreprocessorFactory.class); }
public static SecurityAnalysisPreprocessorFactory factoryForName(String name) { requireNonNull(name); List<SecurityAnalysisPreprocessorFactory> factories = new ServiceLoaderCache<>(SecurityAnalysisPreprocessorFactory.class).getServices(); return factories.stream() .filter(f -> f.getName().equals(name)) .findFirst() .orElseThrow(() -> new PowsyblException("Could not find any security analysis preprocessor for name " + name)); }
SecurityAnalysisPreprocessors { public static SecurityAnalysisPreprocessorFactory factoryForName(String name) { requireNonNull(name); List<SecurityAnalysisPreprocessorFactory> factories = new ServiceLoaderCache<>(SecurityAnalysisPreprocessorFactory.class).getServices(); return factories.stream() .filter(f -> f.getName().equals(name)) .findFirst() .orElseThrow(() -> new PowsyblException("Could not find any security analysis preprocessor for name " + name)); } }
SecurityAnalysisPreprocessors { public static SecurityAnalysisPreprocessorFactory factoryForName(String name) { requireNonNull(name); List<SecurityAnalysisPreprocessorFactory> factories = new ServiceLoaderCache<>(SecurityAnalysisPreprocessorFactory.class).getServices(); return factories.stream() .filter(f -> f.getName().equals(name)) .findFirst() .orElseThrow(() -> new PowsyblException("Could not find any security analysis preprocessor for name " + name)); } private  SecurityAnalysisPreprocessors(); }
SecurityAnalysisPreprocessors { public static SecurityAnalysisPreprocessorFactory factoryForName(String name) { requireNonNull(name); List<SecurityAnalysisPreprocessorFactory> factories = new ServiceLoaderCache<>(SecurityAnalysisPreprocessorFactory.class).getServices(); return factories.stream() .filter(f -> f.getName().equals(name)) .findFirst() .orElseThrow(() -> new PowsyblException("Could not find any security analysis preprocessor for name " + name)); } private  SecurityAnalysisPreprocessors(); static SecurityAnalysisPreprocessorFactory factoryForName(String name); static Optional<SecurityAnalysisPreprocessorFactory> defaultConfiguredFactory(); static Optional<SecurityAnalysisPreprocessorFactory> configuredFactory(PlatformConfig platformConfig); static Optional<SecurityAnalysisPreprocessorFactory> configuredFactory(SecurityAnalysisConfig config); static SecurityAnalysisPreprocessorFactory wrap(ContingenciesProviderFactory factory); static SecurityAnalysisPreprocessor contingenciesPreprocessor(ContingenciesProviderFactory factory,
                                                                   ByteSource source); }
SecurityAnalysisPreprocessors { public static SecurityAnalysisPreprocessorFactory factoryForName(String name) { requireNonNull(name); List<SecurityAnalysisPreprocessorFactory> factories = new ServiceLoaderCache<>(SecurityAnalysisPreprocessorFactory.class).getServices(); return factories.stream() .filter(f -> f.getName().equals(name)) .findFirst() .orElseThrow(() -> new PowsyblException("Could not find any security analysis preprocessor for name " + name)); } private  SecurityAnalysisPreprocessors(); static SecurityAnalysisPreprocessorFactory factoryForName(String name); static Optional<SecurityAnalysisPreprocessorFactory> defaultConfiguredFactory(); static Optional<SecurityAnalysisPreprocessorFactory> configuredFactory(PlatformConfig platformConfig); static Optional<SecurityAnalysisPreprocessorFactory> configuredFactory(SecurityAnalysisConfig config); static SecurityAnalysisPreprocessorFactory wrap(ContingenciesProviderFactory factory); static SecurityAnalysisPreprocessor contingenciesPreprocessor(ContingenciesProviderFactory factory,
                                                                   ByteSource source);  }