public static StringBuilder getOptions(final Collection<String> strs, final String prefixStr) { final StringBuilder builder = new StringBuilder(); for (final String str : strs) { if (builder.length() > 0) { builder.append(","); } else { builder.append(prefixStr); } builder.append("'").append(cleanOptionName(str)).append("'"); } return builder; }
@SuppressWarnings("rawtypes") private static void initPluginProviderRegistry() { pluginProviderRegistry = new HashMap<String, IngestFormatPluginProviderSpi<?, ?>>(); final Iterator<IngestFormatPluginProviderSpi> pluginProviders = new SPIServiceRegistry(IngestFormatPluginRegistry.class).load( IngestFormatPluginProviderSpi.class); while (pluginProviders.hasNext()) { final IngestFormatPluginProviderSpi pluginProvider = pluginProviders.next(); pluginProviderRegistry.put( ConfigUtils.cleanOptionName(pluginProvider.getIngestFormatName()), pluginProvider); } }
private static <T extends GenericFactory> Map<String, T> getRegisteredFactories( final Class<T> cls, Map<String, T> registeredFactories) { if (registeredFactories == null) { registeredFactories = new HashMap<>(); final Iterator<T> storeFactories = new SPIServiceRegistry(GeoWaveStoreFinder.class).load(cls); while (storeFactories.hasNext()) { final T storeFactory = storeFactories.next(); if (storeFactory != null) { final String name = storeFactory.getType(); registeredFactories.put(ConfigUtils.cleanOptionName(name), storeFactory); } } } return registeredFactories; } }