/** Add value to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param value The entry value. */ public void add(String name, V value) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.add(value); super.put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The String array of multiple values. */ public void addValues(String name, V[] values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(Arrays.asList(values)); put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The List of multiple values. */ public void addValues(String name, List<V> values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(values); put(name,lo); }
List<V> vals =get(name); if ((vals == null) || (vals.isEmpty()))
/** Remove value. * @param name The entry key. * @param value The entry value. * @return true if it was removed. */ public boolean removeValue(String name,V value) { List<V> lo = get(name); if((lo == null)||(lo.isEmpty())) { return false; } boolean ret = lo.remove(value); if(lo.isEmpty()) { remove(name); } else { put(name,lo); } return ret; }
/** Add value to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param value The entry value. */ public void add(String name, V value) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.add(value); super.put(name,lo); }
/** Add value to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param value The entry value. */ public void add(String name, V value) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.add(value); super.put(name,lo); }
/** Add value to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param value The entry value. */ public void add(String name, V value) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.add(value); super.put(name,lo); }
/** Add value to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param value The entry value. */ public void add(String name, V value) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.add(value); super.put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The String array of multiple values. */ public void addValues(String name, V[] values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(Arrays.asList(values)); put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The List of multiple values. */ public void addValues(String name, List<V> values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(values); put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The String array of multiple values. */ public void addValues(String name, V[] values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(Arrays.asList(values)); put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The List of multiple values. */ public void addValues(String name, List<V> values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(values); put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The String array of multiple values. */ public void addValues(String name, V[] values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(Arrays.asList(values)); put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The List of multiple values. */ public void addValues(String name, List<V> values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(values); put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The List of multiple values. */ public void addValues(String name, List<V> values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(values); put(name,lo); }
/** Add values to multi valued entry. * If the entry is single valued, it is converted to the first * value of a multi valued entry. * @param name The entry key. * @param values The String array of multiple values. */ public void addValues(String name, V[] values) { List<V> lo = get(name); if(lo == null) { lo = new ArrayList<>(); } lo.addAll(Arrays.asList(values)); put(name,lo); }
private String getParameterBytesAsString (String name, byte[] bytes) throws UnsupportedEncodingException { //check if there is a specific encoding for the parameter Object ct = _params.get(name+CONTENT_TYPE_SUFFIX); //use default if not String contentType = _encoding; if (ct != null) { String tmp = MimeTypes.getCharsetFromContentType(new ByteArrayBuffer((String)ct)); contentType = (tmp == null?_encoding:tmp); } return new String(bytes,contentType); } }
/** Remove value. * @param name The entry key. * @param value The entry value. * @return true if it was removed. */ public boolean removeValue(String name,V value) { List<V> lo = get(name); if((lo == null)||(lo.isEmpty())) { return false; } boolean ret = lo.remove(value); if(lo.isEmpty()) { remove(name); } else { put(name,lo); } return ret; }
/** Remove value. * @param name The entry key. * @param value The entry value. * @return true if it was removed. */ public boolean removeValue(String name,V value) { List<V> lo = get(name); if((lo == null)||(lo.isEmpty())) { return false; } boolean ret = lo.remove(value); if(lo.isEmpty()) { remove(name); } else { put(name,lo); } return ret; }