Interface IJsonObject
Interface that is used for the custom implementation of the JSON Object type to be used in NCache.
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public interface IJsonObject : IEnumerable<KeyValuePair<string, JsonValueBase>>, IEnumerable
Properties
Count
Number of items in the collection.
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | Number of items. |
Item[String]
Key based indexer for JSON Object.
Declaration
JsonValueBase this[string attributeName] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | Key for indexing. |
Property Value
Type | Description |
---|---|
JsonValueBase | Value associated with the attribute name. |
Methods
AddAttribute(String, JsonValue)
Adds JSONValue object with the unique attribute name.
Declaration
void AddAttribute(string attributeName, JsonValue attributeValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | Key against which JSONValue is identified. |
JsonValue | attributeValue | JSONValue to be added. |
AddAttribute(String, JsonValueBase)
Adds JSONValueBase object with the unique attribute name.
Declaration
void AddAttribute(string attributeName, JsonValueBase attributeValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | Key against which JSONValueBase is identified. |
JsonValueBase | attributeValue | JSONValueBase to be added. |
Clear()
Clears all the items in the JSONObject and brings the count of attributes to 0.
Declaration
void Clear()
ContainsAttribute(String)
Checks if any entry exits against attribute name.
Declaration
bool ContainsAttribute(string attributeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | Key to search in the JSONObject. |
Returns
Type | Description |
---|---|
System.Boolean | True, if the key exists. |
GetAttributeNames()
Gets all the attribute names.
Declaration
ICollection<string> GetAttributeNames()
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.String> | System.Collections.Generic.ICollection |
GetAttributeValue(String)
Gets attribute against the specified attribute name.
Declaration
JsonValueBase GetAttributeValue(string attributeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | Key that identifies the JSONObject. |
Returns
Type | Description |
---|---|
JsonValueBase | JSONObject against the key specified if exits. |
RemoveAttribute(String)
Removes the attribute entry identified by the attribute name.
Declaration
bool RemoveAttribute(string attributeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | Unique key that identifies the attribute. |
Returns
Type | Description |
---|---|
System.Boolean | True, if attribute removed successfully. |