Class MutableMessageHeaders
- Namespace
- Steeltoe.Integration.Support
- Assembly
- Steeltoe.Integration.IntegrationBase.dll
[Obsolete("This feature will be removed in the next major version. See https://steeltoe.io/docs/v3/obsolete for details.")]
public class MutableMessageHeaders : MessageHeaders, IMessageHeaders, IDictionary, ICollection, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
- Inheritance
-
MutableMessageHeaders
- Implements
- Inherited Members
Constructors
MutableMessageHeaders(IDictionary<string, object>)
public MutableMessageHeaders(IDictionary<string, object> headers)
Parameters
headersIDictionary<string, object>
MutableMessageHeaders(IDictionary<string, object>, string, long?)
public MutableMessageHeaders(IDictionary<string, object> headers, string id, long? timestamp)
Parameters
headersIDictionary<string, object>idstringtimestamplong?
Properties
this[string]
Gets or sets the element with the specified key.
public override object this[string key] { get; set; }
Parameters
keystringThe key of the element to get or set.
Property Value
- object
The element with the specified key.
Exceptions
- ArgumentNullException
keyis null.- KeyNotFoundException
The property is retrieved and
keyis not found.- NotSupportedException
The property is set and the IDictionary<TKey, TValue> is read-only.
Methods
Add(KeyValuePair<string, object>)
Adds an item to the ICollection<T>.
public override void Add(KeyValuePair<string, object> item)
Parameters
itemKeyValuePair<string, object>The object to add to the ICollection<T>.
Exceptions
- NotSupportedException
The ICollection<T> is read-only.
Add(string, object)
Adds an element with the provided key and value to the IDictionary<TKey, TValue>.
public override void Add(string key, object value)
Parameters
keystringThe object to use as the key of the element to add.
valueobjectThe object to use as the value of the element to add.
Exceptions
- ArgumentNullException
keyis null.- ArgumentException
An element with the same key already exists in the IDictionary<TKey, TValue>.
- NotSupportedException
The IDictionary<TKey, TValue> is read-only.
AddRange(IDictionary<string, object>)
public virtual void AddRange(IDictionary<string, object> map)
Parameters
mapIDictionary<string, object>
Clear()
Removes all elements from the IDictionary object.
public override void Clear()
Exceptions
- NotSupportedException
The IDictionary object is read-only.
Remove(KeyValuePair<string, object>)
Removes the first occurrence of a specific object from the ICollection<T>.
public override bool Remove(KeyValuePair<string, object> item)
Parameters
itemKeyValuePair<string, object>The object to remove from the ICollection<T>.
Returns
- bool
true if
itemwas successfully removed from the ICollection<T>; otherwise, false. This method also returns false ifitemis not found in the original ICollection<T>.
Exceptions
- NotSupportedException
The ICollection<T> is read-only.
Remove(string)
Removes the element with the specified key from the IDictionary<TKey, TValue>.
public override bool Remove(string key)
Parameters
keystringThe key of the element to remove.
Returns
- bool
true if the element is successfully removed; otherwise, false. This method also returns false if
keywas not found in the original IDictionary<TKey, TValue>.
Exceptions
- ArgumentNullException
keyis null.- NotSupportedException
The IDictionary<TKey, TValue> is read-only.