Interface IPrimitiveMap
Represents a Map of primitive types where the keys are all string instances and the values are strings or numbers.
Namespace: CodersRealm.AmqpClient
Assembly: CodersRealm.AmqpClient.dll
Syntax
public interface IPrimitiveMap
Properties
Count
Gets the number of key/value pairs contained in the map.
Declaration
int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[string]
Gets or sets the value associated with the specified key.
Declaration
object this[string key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to get or set. |
Property Value
| Type | Description |
|---|---|
| object | The value associated with the specified key. |
Keys
Gets a collection containing the keys in the map.
Declaration
ICollection Keys { get; }
Property Value
| Type | Description |
|---|---|
| ICollection |
Values
Gets a collection containing the values in the map.
Declaration
ICollection Values { get; }
Property Value
| Type | Description |
|---|---|
| ICollection |
Methods
Clear()
Removes all entries from the map.
Declaration
void Clear()
Contains(object)
Determines whether the map contains an element with the specified key.
Declaration
bool Contains(object key)
Parameters
| Type | Name | Description |
|---|---|---|
| object | key | The key to locate in the map. |
Returns
| Type | Description |
|---|---|
| bool | true if the map contains an element with the specified key; otherwise, false. |
GetBool(string)
Retrieves the value with the specified key and converts it to a boolean.
Declaration
bool GetBool(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to retrieve. |
Returns
| Type | Description |
|---|---|
| bool | The boolean value associated with the specified key. |
GetByte(string)
Retrieves the value with the specified key and converts it to a byte.
Declaration
byte GetByte(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to retrieve. |
Returns
| Type | Description |
|---|---|
| byte | The byte value associated with the specified key. |
GetBytes(string)
Retrieves the byte array stored at the specified key.
Declaration
byte[] GetBytes(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the byte array to retrieve. |
Returns
| Type | Description |
|---|---|
| byte[] | The byte array associated with the specified key. |
GetChar(string)
Retrieves the value with the specified key and converts it to a char.
Declaration
char GetChar(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to retrieve. |
Returns
| Type | Description |
|---|---|
| char | The char value associated with the specified key. |
GetDictionary(string)
Retrieves the IDictionary stored at the specified key.
Declaration
IDictionary? GetDictionary(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the dictionary to retrieve. |
Returns
| Type | Description |
|---|---|
| IDictionary | The IDictionary associated with the specified key, or null if not present. |
GetDouble(string)
Retrieves the value with the specified key and converts it to a double.
Declaration
double GetDouble(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to retrieve. |
Returns
| Type | Description |
|---|---|
| double | The double value associated with the specified key. |
GetFloat(string)
Retrieves the value with the specified key and converts it to a float (Single).
Declaration
float GetFloat(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to retrieve. |
Returns
| Type | Description |
|---|---|
| float | The float value associated with the specified key. |
GetInt(string)
Retrieves the value with the specified key and converts it to an int (Int32).
Declaration
int GetInt(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to retrieve. |
Returns
| Type | Description |
|---|---|
| int | The int value associated with the specified key. |
GetList(string)
Retrieves the IList stored at the specified key.
Declaration
IList? GetList(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the list to retrieve. |
Returns
| Type | Description |
|---|---|
| IList | The IList associated with the specified key, or null if not present. |
GetLong(string)
Retrieves the value with the specified key and converts it to a long (Int64).
Declaration
long GetLong(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to retrieve. |
Returns
| Type | Description |
|---|---|
| long | The long value associated with the specified key. |
GetShort(string)
Retrieves the value with the specified key and converts it to a short (Int16).
Declaration
short GetShort(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to retrieve. |
Returns
| Type | Description |
|---|---|
| short | The short value associated with the specified key. |
GetString(string)
Retrieves the value with the specified key and converts it to a string.
Declaration
string GetString(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to retrieve. |
Returns
| Type | Description |
|---|---|
| string | The string value associated with the specified key. |
Remove(object)
Removes the element with the specified key from the map.
Declaration
void Remove(object key)
Parameters
| Type | Name | Description |
|---|---|---|
| object | key | The key of the element to remove. |
SetBool(string, bool)
Sets the boolean value for the specified key.
Declaration
void SetBool(string key, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the value to. |
| bool | value | The boolean value to store. |
SetByte(string, byte)
Sets the byte value for the specified key.
Declaration
void SetByte(string key, byte value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the value to. |
| byte | value | The byte value to store. |
SetBytes(string, byte[])
Stores a byte array at the specified key.
Declaration
void SetBytes(string key, byte[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the byte array to. |
| byte[] | value | The byte array to store. |
SetBytes(string, byte[], int, int)
Stores a range from the provided byte array at the specified key.
Declaration
void SetBytes(string key, byte[] value, int offset, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the bytes to. |
| byte[] | value | The source byte array. |
| int | offset | The zero-based byte offset in value at which to begin copying bytes. |
| int | length | The number of bytes to copy from value. |
SetChar(string, char)
Sets the char value for the specified key.
Declaration
void SetChar(string key, char value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the value to. |
| char | value | The char value to store. |
SetDictionary(string, IDictionary)
Stores an IDictionary at the specified key.
Declaration
void SetDictionary(string key, IDictionary dictionary)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the dictionary to. |
| IDictionary | dictionary | The IDictionary to store. |
SetDouble(string, double)
Sets the double value for the specified key.
Declaration
void SetDouble(string key, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the value to. |
| double | value | The double value to store. |
SetFloat(string, float)
Sets the float (Single) value for the specified key.
Declaration
void SetFloat(string key, float value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the value to. |
| float | value | The float value to store. |
SetInt(string, int)
Sets the int (Int32) value for the specified key.
Declaration
void SetInt(string key, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the value to. |
| int | value | The int value to store. |
SetList(string, IList)
Stores an IList at the specified key.
Declaration
void SetList(string key, IList list)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the list to. |
| IList | list | The IList to store. |
SetLong(string, long)
Sets the long (Int64) value for the specified key.
Declaration
void SetLong(string key, long value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the value to. |
| long | value | The long value to store. |
SetShort(string, short)
Sets the short (Int16) value for the specified key.
Declaration
void SetShort(string key, short value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the value to. |
| short | value | The short value to store. |
SetString(string, string)
Sets the string value for the specified key.
Declaration
void SetString(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to assign the value to. |
| string | value | The string value to store. |