public boolean containsKey(Object key) { if (key == null) { return false; } if (!(key instanceof String)) { return false; } return map.containsKey (normalize((String)key)); }
public List<String> put(String key, List<String> value) { return map.put (normalize(key), value); }
public List<String> get(Object key) { return map.get(normalize((String)key)); }
public List<String> remove(Object key) { return map.remove(normalize((String)key)); }
/** * returns the first value from the List of String values * for the given key (if at least one exists). * @param key the key to search for * @return the first string value associated with the key */ public String getFirst (String key) { List<String> l = map.get(normalize((String)key)); if (l == null) { return null; } return l.get(0); }
/** * adds the given value to the list of headers * for the given key. If the mapping does not * already exist, then it is created * @param key the header name * @param value the header value to add to the header */ public void add (String key, String value) { String k = normalize(key); List<String> l = map.get(k); if (l == null) { l = new LinkedList<String>(); map.put(k,l); } l.add (value); }