List of utility methods to do Dictionary Usage
void | addReferenceIdsToServiceProperties(String prefix, Map add Reference Ids To Service Properties Object serviceId = referenceProps.get("service.id"); if (serviceId != null) { serviceProps.put(prefix + ".service.id", serviceId); Object servicedPid = referenceProps.get("service.pid"); if (servicedPid != null) { serviceProps.put(prefix + ".service.pid", servicedPid); |
boolean | containsKey(Dictionary dict, String key) contains Key if (dict == null || key == null) { return false; return dict.get(key) != null; |
Boolean | getBoolean(Dictionary p, Object key, Boolean defaultValue) get Boolean Object value = p.get(key); if (value == null) return defaultValue; if (value instanceof Boolean) return (Boolean) value; String s = value.toString().toLowerCase().trim(); if (s.equals("true") || s.equals("yes")) return new Boolean(true); ... |
String | getSpringContextHeader(Dictionary Return the #SPRING_CONTEXT_HEADER if present from the given dictionary. Object header = null; if (headers != null) header = headers.get(SPRING_CONTEXT_HEADER); return (header != null ? header.toString().trim() : null); |
Boolean | getState(Dictionary Getter for the state of a boolean type property. Object value = conf.get(property); if (value instanceof String) { String strVal = ((String) value).trim(); if ("0".equals(strVal)) { return false; } else if ("1".equals(strVal)) { return true; } else { ... |
String | getString(Dictionary p, Object key, String defaultValue) get String Object value = p.get(key); if (value == null) return defaultValue; else return value.toString(); |
boolean | isNullOrNothing(final Object[] array) is Null Or Nothing return array == null || array.length == 0;
|
void | parseRequestOption(Dictionary Parses a request option from the configuration parameters. Boolean state = getState(conf, confParam);
if (state != null) {
String reqParam = confParam.substring(3);
requestOptions.put(reqParam, state);
|
void | setDefault(Dictionary Puts the given key-value pair in the given dictionary if the key does not already exist in it or if its existing value is null. if (dict.get(key) == null) {
dict.put(key, value);
|
void | setProperty(Dictionary set Property if (value != null) {
properties.put(key, value);
|