public Map<String, String> getMessageFormatPerTopic() { String prefix = "secor.topic.message.format"; Iterator<String> keys = mProperties.getKeys(prefix); Map<String, String> topicMessageFormats = new HashMap<String, String>(); while (keys.hasNext()) { String key = keys.next(); String topic = mProperties.getString(key); topicMessageFormats.put(key.substring(prefix.length() + 1), topic); } return topicMessageFormats; }
public Map<String, String> getProtobufMessageClassPerTopic() { String prefix = "secor.protobuf.message.class"; Iterator<String> keys = mProperties.getKeys(prefix); Map<String, String> protobufClasses = new HashMap<String, String>(); while (keys.hasNext()) { String key = keys.next(); String className = mProperties.getString(key); protobufClasses.put(key.substring(prefix.length() + 1), className); } return protobufClasses; }
public Map<String, String> getThriftMessageClassPerTopic() { String prefix = "secor.thrift.message.class"; Iterator<String> keys = mProperties.getKeys(prefix); Map<String, String> thriftClasses = new HashMap<String, String>(); while (keys.hasNext()) { String key = keys.next(); String className = mProperties.getString(key); thriftClasses.put(key.substring(prefix.length() + 1), className); } return thriftClasses; }
/** * This method is used for fetching all the properties which start with the given prefix. * It returns a Map of all those key-val. * * e.g. * a.b.c=val1 * a.b.d=val2 * a.b.e=val3 * * If prefix is a.b then, * These will be fetched as a map {c = val1, d = val2, e = val3} * * @param prefix property prefix * @return */ public Map<String, String> getPropertyMapForPrefix(String prefix) { Iterator<String> keys = mProperties.getKeys(prefix); Map<String, String> map = new HashMap<String, String>(); while (keys.hasNext()) { String key = keys.next(); String value = mProperties.getString(key); map.put(key.substring(prefix.length() + 1), value); } return map; }
indexMaps.add(new HashMap<>()); Iterator keys = configuration.getKeys(); while (keys.hasNext()) { String key = (String) keys.next();
+ ")"); final Iterator<String> keysToMangle = Iterators.filter(configuration.getKeys(), new Predicate<String>() { @Override public boolean apply(String key) {
Iterator keys = mapConfig.getKeys(); while (keys.hasNext()) { String key = (String) keys.next();
Iterator<String> iter = apc.getKeys();
+ ")"); final Iterator<String> keysToMangle = Iterators.filter(configuration.getKeys(), key -> null != key && p.matcher(key).matches());
Iterator<String> iterator = apc.getKeys();
HashMap<String, Object> confMap = new HashMap<>(); PropertiesConfiguration config = getConf(); Iterator<String> keys = config.getKeys(); while (keys.hasNext()) { String key = keys.next();
public static void loadConfiguration(final String fileName) { try { PropertiesConfiguration.setDefaultListDelimiter('\0'); final PropertiesConfiguration config = new PropertiesConfiguration(fileName); final Iterator<String> keys = config.getKeys(); while (keys.hasNext()) { final String key = keys.next(); final String value = trim(config.getString(key)); Setting<?> setting = Settings.getSetting(key); if (setting != null) { setting.fromString(value); } else { SettingsGroup targetGroup = miscGroup; // put key in cron group if it contains ".cronExpression" if (key.contains(".cronExpression")) { targetGroup = cronGroup; } // create new StringSetting for unknown key Settings.createSettingForValue(targetGroup, key, value); } } } catch (ConfigurationException ex) { System.err.println("Unable to load configuration: " + ex.getMessage()); } }
@Override public Iterator<String> getKeys() { return conf.getKeys(); }
private String getDeviceNickname(String connectorAndObjectType) { Iterator<String> keys = env.bodytrackProperties.getKeys(); while (keys.hasNext()) { String key = keys.next(); if (key.startsWith(connectorAndObjectType)) { if (key.endsWith("dev_nickname")) return (String) env.bodytrackProperties.getProperty(key); } } return null; }
public void setBodytrackProperties(PropertiesConfiguration properties) throws IOException { final Iterator<String> keys = properties.getKeys(); bodytrackToFluxtreamConnectorNames = new ConcurrentHashMap<String,String>(); while(keys.hasNext()) { String key = keys.next(); if (key.indexOf(".dev_nickname")!=-1) { bodytrackToFluxtreamConnectorNames.put(properties.getString(key), key.substring(0, key.indexOf("."))); } } this.bodytrackProperties = properties; }
@Override public String toString() { StringBuilder propertyValues = new StringBuilder(); for (Iterator<?> it = propertiesConfiguration.getKeys(); it.hasNext();) { String key = (String) it.next(); Object value = propertiesConfiguration.getProperty(key); propertyValues.append("key=" + key + " value=" + value.toString()); } return propertyValues.toString(); }
@SuppressWarnings("unchecked") public <T> Map<String, T> getAllProperties() throws ConfigurationException { Map<String, T> map = new HashMap<String, T>(); for (Iterator<?> it = propertiesConfiguration.getKeys(); it.hasNext();) { String key = (String) it.next(); if (!map.containsKey(key)) { map.put(key, (T) propertiesConfiguration.getProperty(key)); } } return map; }
private Map<String, Object> toMap() { Map<String, Object> result = new HashMap<>(); Iterator<String> keys = propertiesConfiguration.getKeys(); while ( keys.hasNext() ) { String next = keys.next(); result.put( next, propertiesConfiguration.getProperty( next ) ); } return result; }
public static void printConfigOptions(PropertiesConfiguration config, String path_fragment) { Iterator<String> itr = config.getKeys(); while(itr.hasNext()) { String key = itr.next(); if(key.contains(path_fragment)) { System.out.println("[OpenSOC] Key: " + key + " -> " + config.getString(key)); } } }
public List<Property> getProps() { PropertiesConfigurationLayout layout = properties.getLayout(); List<Property> props = new ArrayList<Property>(); Iterator keys = properties.getKeys(); while (keys.hasNext()) { String key = (String)keys.next(); props.add(new Property(adjustComment(layout.getCanonicalComment(key, true)), key, isIdentifier(key), properties.getString(key))); } return props; }