Added removeHeader() method to MessageBuilder.

This commit is contained in:
Mark Fisher
2008-09-02 22:24:37 +00:00
parent 6f2f1640bd
commit 614ffaf825
2 changed files with 31 additions and 0 deletions

View File

@@ -96,6 +96,16 @@ public final class MessageBuilder<T> {
return this;
}
/**
* Remove the value for the given header name.
*/
public MessageBuilder<T> removeHeader(String headerName) {
if (StringUtils.hasLength(headerName)) {
this.headers.remove(headerName);
}
return this;
}
/**
* Copy the name-value pairs from the provided Map. This operation will
* overwrite any existing values. Use {{@link #copyHeadersIfAbsent(Map)}