private void doAddHeaderValue(String name, Object value, boolean replace) { HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); Assert.notNull(value, "Header value must not be null"); if (header == null) { header = new HeaderValueHolder(); this.headers.put(name, header); } if (replace) { header.setValue(value); } else { header.addValue(value); } }
public void addHeader(String name, Object value) { HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); if (header == null) { header = new HeaderValueHolder(); this.headers.put(name, header); } if (value instanceof Collection) { header.addValues((Collection) value); } else if (value.getClass().isArray()) { header.addValueArray(value); } else { header.addValue(value); } }
@SuppressWarnings("rawtypes") private void doAddHeaderValue(String name, Object value, boolean replace) { HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); Assert.notNull(value, "Header value must not be null"); if (header == null || replace) { header = new HeaderValueHolder(); this.headers.put(name, header); } if (value instanceof Collection) { header.addValues((Collection) value); } else if (value.getClass().isArray()) { header.addValueArray(value); } else { header.addValue(value); } }