From c9cdff0aeea66e712059d5faf380b1f2ec80c3c1 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Tue, 22 Apr 2008 13:40:42 +0000 Subject: [PATCH] Added removeAttribute() and removeProperty() methods (INT-203, INT-204). --- .../integration/message/MessageHeader.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHeader.java b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHeader.java index 1b327b3b1f..59d3280a20 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHeader.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHeader.java @@ -125,6 +125,10 @@ public class MessageHeader implements Serializable { return (String) this.properties.setProperty(key, value); } + public String removeProperty(String key) { + return (String) this.properties.remove(key); + } + public Set getPropertyNames() { Set propertyNames = new HashSet(); for (Object key : this.properties.keySet()) { @@ -145,6 +149,10 @@ public class MessageHeader implements Serializable { return this.attributes.putIfAbsent(key, value); } + public Object removeAttribute(String key) { + return this.attributes.remove(key); + } + public Set getAttributeNames() { return this.attributes.keySet(); }